Hi Agendum,
It seems that the compiler didn't recognize Test1() : Test1 correctly. You
may change it to:
public class Test1 { }
public class Test2
{
public function get MyTest1() : Test1
{
return null;
}
}
After rename the function to "MyTest1", the compiler can work with it.
Luke
Microsoft Online Partner Support

Signature
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
> Take the following example:
>
[quoted text clipped - 9 lines]
> This will result in the compiler error:
> JS1110: Expression must be a compile time constant
Hi,
A limitation of the compiler means that you can't have members with the same
name as types. This is a side-effect of the other question you posted (which
I just replied to) about how to get the type of a type in JScript -- you
don't need to do anything, because a typename by itself in code represents
that type object:
class foo {}
print(foo)
this will print "foo" because foo is a Type and so JScript calls ToString on
the type, which of course prints its name.
This if you have:
class Test {}
class foo {}
{
function get Test() : Test {}
}
The compiler gets confused when compiling the Test property because you are
trying to make "Test" both a property and a type. You must fully-qualify all
references to the Test type in order to make it work
> public class Test1 { }
> public class Test2
[quoted text clipped - 7 lines]
> This works fine. However, is there a supported way to accomplish this with
> future compatibility?
You can put Test1 in its own namespace (by creating a DLL with a 'package')
and then use the fully-qualified name of Test1.
Peter

Signature
Please post questions to the newsgroup - everyone benefits.
This post is provided "AS IS" with no warranties, and confers no rights
Sample code subject to http://www.microsoft.com/info/cpyright.htm
Bore yourself to tears -- http://blogs.gotdotnet.com/ptorr