This kind of makes sense in a way I can't quite put my finger on...
What I think I'm doing here is giving an overrided type a different return type than its parent. This is good (excellent for my purposes!) but kind of surprised me.
Why can I override the type of a variable by extending, but not the return type of a method?
With this in mind, I am probably very confused about a lot of things...
Strict Type MainTypeData Field name:String="MainType" End Type Type ChildTypeData Field name:String="ChildType" Field iamdifferent:String="I am different!" End Type Type MainType Field data:MainTypeData=New MainTypeData Field bleh:Int=4 End Type Type ChildType Extends MainType Field data:ChildTypeData=New ChildTypeData Field bleh:Float=4.51 End Type Local Main:MainType=New MainType Local Child:ChildType=New ChildType WriteStdout(Main.data.name+" bleh is ") WriteStdout(Main.bleh+"~n") WriteStdout(Child.data.name+" bleh is ") WriteStdout(Child.bleh+"~n") End
What I think I'm doing here is giving an overrided type a different return type than its parent. This is good (excellent for my purposes!) but kind of surprised me.
Why can I override the type of a variable by extending, but not the return type of a method?
With this in mind, I am probably very confused about a lot of things...