[nem-en] Known types from macroses problem.
Ivan A Eryshov
ivan.eryshov at gmail.com
Wed May 2 09:32:48 CEST 2007
Guys,
macro.n:
<code>
macro GetType()
{
def tp = "System.Int32";
def nm = Name(tp);
def ex = PExpr.Ref(nm);
ex
}
macro GetType2()
{
def tp = "System.Int32";
def nm = Name(tp);
def ex = PExpr.Ref(nm);
<[ typeof($ex) ]>
}
</code>
test.n
<code>
WriteLine(typeof (GetType())); // Error: 'GetType ()' is not a legal
type expression
WriteLine(GetType2()); // Error: unbound type name 'System.Int32'
</code>
How to make this code working? Specially, I'm intrerested in working
2nd macro - GetType2.
Please advice.
More information about the devel-en
mailing list