You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When providing inlined getter/setter combinations which refer to an Emit-attributed property on an abstract type, calls to the getter result in calls to the setter with either "null" or the setter variable name placed literally in the JS side, where no assignment should be taking place at all.
Repro code
[<AbstractClass>]typeTestClass=//Note the use of int IDs- this is an interface for having friendly names on an array- it will most certainly not have a "prop" attribute on the JS side.[<Emit("$0[$1]{{=$2}}")>]abstract Item: name:int->objwith get, set
memberinline __.prop with get():string =__.[0]:?> string andset(v:string):unit =__.[0]<- v
moduleTestClass =let inlinecreate(prop:string):TestClass =[| box prop |]:> obj :?> TestClass
[<EntryPoint>]letmain args =lettc= TestClass.create "test"if(tc.prop <>"test")then failwith "Value not correctly accessed"0
Expected Result:
Getters should not produce assignments. Once #654 is resolved, non-inline getters should properly map to their concrete implementations rather than being treated as abstract.
Related information
fable-compiler version: 0.7.30
fable-core version: 0.7.22
Operating system: Win10x64
The text was updated successfully, but these errors were encountered:
I'll check this but it looks as if an interface would be more appropriate in this case (an abstract class will be compiled as an actual ES6 class, see #654):
Description
When providing inlined getter/setter combinations which refer to an
Emit
-attributed property on an abstract type, calls to the getter result in calls to the setter with either "null" or the setter variable name placed literally in the JS side, where no assignment should be taking place at all.Repro code
Expected and actual results
Compiled Result:
See https://gist.github.com/Dessix/313635c089705dd11805b24e41fef845
Expected Result:
Getters should not produce assignments. Once #654 is resolved, non-inline getters should properly map to their concrete implementations rather than being treated as abstract.
Related information
The text was updated successfully, but these errors were encountered: