back2dos / tinkerbell

MIT License
83 stars 8 forks source link

explain how / add support for structural type matches #29

Closed jslenk-duffresearch closed 11 years ago

jslenk-duffresearch commented 11 years ago

if i have a class that uses tink.lang.Cls and then has e.g. @:read var foo:String, and then i want it to match a typedef structural type, what is the right definition of the structural type?

typedef TFoo = { function get_foo():String; } seems to give me "the field get_foo() is not public".

back2dos commented 11 years ago

This should do it: typedef TFoo = { var foo(get_foo, null):String; }

jslenk-duffresearch commented 11 years ago

i just figured that out, too, thanks. was going to post here but then was confused that the issue disappeared, then realized it was closed already :-)