I tried fixed version and unfortunately I think that bug is still here. The code I posted as test case seems to me quite valid, but compiler now complains:
testcase.fan(26,26): Unexpected closure
I think there is bug in parser, because when I modify testcase like:
jantrtik Wed 14 Nov 2012
Hello,
I stumbled upon internal compiler error:
Parser is unable to cope with code like this:
@Js facet class SomeFacet { const Property[] props } @Js const class Property { const Str name const [Str:Obj] conf := Str:Obj[:] new make(|This|? f) { if(f != null) f(this) } } ** ** mixin 1 ** mixin Mixin1 { abstract Str field abstract Str method() } @Js @SomeFacet{props = [Property{name = "prop1"},]} class Class1 { static Void main() { echo("Hello World") } }Have a nice day, Jan
brian Wed 14 Nov 2012
thanks for reporting, I pushed a fix
jantrtik Wed 14 Nov 2012
Hello,
I tried fixed version and unfortunately I think that bug is still here. The code I posted as test case seems to me quite valid, but compiler now complains:
I think there is bug in parser, because when I modify testcase like:
@Js facet class Facet1{ const Property[] props } @Js const class Property{ const Str name const [Str:Obj] conf := Str:Obj[:] new make(|This|? f){ if(f != null) f(this) } } @Js @Facet1{props = [Property{name = "prop1"},]} class Class1 { static Void main() { echo("Hello World") } } ** ** mixin 1 ** mixin Mixin1 { abstract Str field abstract Str method() }everything works as expected... both testcases differs only in position of Mixin1 definition.
Have a nice day, Jan