haxetink / tink_json

Macro powered JSON.
The Unlicense
34 stars 9 forks source link

Allow final class fields to be serialized? #79

Closed cambiata closed 3 years ago

cambiata commented 3 years ago

This doesn't seem to work right now. "Just" a missing implementation?

@:jsonParse(function(json) return new App.Test(json.level))
class Test {

    //  Causes tink/macro/Types.hx:47: "Uncaught exception not implemented"
    public final level:Int; 

    public function new(level:Int) {
        this.level = level;
    }
}
back2dos commented 3 years ago

Mhh, I'll have to think about how to make this right in tink_macro. In the meantime, please use a custom @:jsonStringify ;)

cambiata commented 3 years ago

Thx!