Open pekabon opened 11 years ago
Seems compiler doesn't support quotes for type statement. You can use <[ type x = $(m : usesite) ]> , rather than 'dyn'.
<[ type x = $(m : usesite) ]> is not my case, I want <[ type $(x : usesite) = $(m : usesite) ]> (doesn't compile)
but now I have workaround, thanx:
def a = "myuint";
def b = "int";
def typePExpr = <[$(b : usesite]>;
def name = Splicable.Name(<[$(a : usesite)]>);
def topDeclaration = TopDeclaration.Alias(name, AttributesAndModifiers(), Typarms.Empty, typePExpr);
def typeDeclaration = ClassMember.TypeDeclaration(name, topDeclaration);
def builder = typer.Env.Define(typeDeclaration);
builder.Compile();
The problem that compiler doesn't support this kind of quote , you can teach compiler to support it :)
this code compile successfully:
this one doesn't:
output error : parse error near operator
$': expecting
=',;' or
{' in field / property declaration error : parse error near operator `$': unexpected token after class member (you forget a closing bracket?).trying workaround, this compiles and works:
but this code doesn't (ICE):