in editor script MissingFieldException:parent

I get this error

MissingFieldException: Cannot find variable parent.
Boo.Lang.Runtime.RuntimeServices.SetProperty (System.Object target, System.String name, System.Object value)
SaveTile.SaveTile () (at assets/standard assets/editor/SaveTile.js:6)

with this editor code

@MenuItem ("GameObject/SaveTile")
static function SaveTile () {
	oldTile = Selection.activeTransform;
	newTile = Instantiate(oldTile,oldTile.transform.localPosition,oldTile.localRotation);
	tiles = GameObject.Find("Tiles");
	newTile.transform.parent = tiles;
}

I don’t understand how a newly instantiate transform can not have a parent field. I also tried
newTile.parent = tiles;
and got the same error message.
I use similiar code writen in boo in my game and it works fine.

Cheers,
Grant

tiles is a gameObject.

Btw. If you write var in front of your variable declarations, the compiler would infer the type and give you the error at compile time, which is probably more detailed.
You can also put a #pragma strict in front of a script to turn off dynamic typing entirely.

Thanks that fixed it.

Also in case there is another Boo programmer out there (have not found one in the forums so far) This is how you do editor functions in boo

import UnityEngine
import UnityEditor

class Savetile2( MonoBehaviour):
	[MenuItem ("GameObject/SaveTile")]
	static def  SaveTile () :
		oldTile = Selection.activeTransform;
		newTile = Instantiate(oldTile,oldTile.transform.localPosition,oldTile.localRotation);
		tiles = GameObject.Find("Tiles");
		newTile.parent = tiles.transform;

Cheers,
Grant