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
I have a class hierarchy that implements IAspect<'C> and overrides the Attach method. The bottom-most class(ProjectSelection) is causing Fable to generate code that fails at runtime, making reference to a non-existent method. This is caught by the example program below, and printed.
I've trimmed this down from my application code. If I remove the <'C> templating parameter, the issue goes away. That may be useful in tracking the issue down.
Bad code in class ProjectSelection:
"OverrideIssue.AspectBase`1.Attach2B595"(owner){super["OverrideIssue.AspectBase`1.Attach1505"](owner);// Attach1505 is undefinedtoConsole(printf("ProjectSelection: attach to %A"))(owner);}
Repro code
moduleOverrideIssuetypeIAspect<'C>=abstract Attach: 'C -> unit
[<AbstractClass>]typeAspectBase<'C>()=abstract Attach: 'C -> unit
defaultthis.Attach(owner):unit =
printfn "AspectBase: attach to %A" owner
interface IAspect<'C>withmember__.Attach(owner):unit =__.Attach(owner)typeSelectionAspect<'Container>()=inherit AspectBase<'Container>()override__.Attach(owner)=base.Attach(owner)
printfn "SelectionAspect: attach to %A" owner
typeProjectSelection()=inherit SelectionAspect<string>()override__.Attach(owner)=base.Attach(owner)
printfn "ProjectSelection: attach to %A" owner
try(new ProjectSelection()).Attach("root")with| x -> printfn "Error: %s" x.Message
Description
I have a class hierarchy that implements
IAspect<'C>
and overrides theAttach
method. The bottom-most class(ProjectSelection
) is causing Fable to generate code that fails at runtime, making reference to a non-existent method. This is caught by the example program below, and printed.I've trimmed this down from my application code. If I remove the
<'C>
templating parameter, the issue goes away. That may be useful in tracking the issue down.Bad code in class
ProjectSelection
:Repro code
Fable REPL URL
https://fable.io/repl/#?code=LYewJgrgNgpgBAeQG4wE6oJZhgSQM54QwBQxALgJ4AO8OAgnjQMZkA8A5AMIB8cAvMThC4AQwBGeMqhEs4dMmRkALAFxwucALS8IAOwxlSAbVZ0JUmWU5QRBbgF1y1eA2ZkAQrZgceACjgAlPykwqLm0rLyikyq6pxaOvqGodgAZiLQZHBkShh4AHRRynC+IADuumgBanoG-HCCocJUmLpkqbpwAESuMCyeeDBqIgrFZCBwAKR0XXDllaghwhhtaOlMtL0sPrxlBkqNTXDAMMBiaHAA+peFozEl81U1SfXXt9FKpRVVpJQ0cABlGCwFgYEC6LZsLjgxQrNDcfxBAShFZKNB1SEDbzQtoiOGoBEBJZCEAodBYeBvIoxL4LJENI5CMRed7KWk-RlwFordqdLpAkFkMEQxh9MjDO5KbITaazR6LJz-AAKqBAACsxQKxcLfEjDnBUeislrQeDIaxJK0AOaE4lzMmYbBXG7Uz7y+n60LMwasmnuz3NVq87oq9Wa4Ha8ESj7SqYzObfBVSCj63yVMpwUMalgmoXg3UBX2fLqqkBkLpEvY5YgAHzgAA8Elygx1ugBRdAgVBqSZ4Wb1-IAWRgBBEVpgQA&html=Q&css=Q
Expected output
Actual output
Related information
dotnet fable --version
4.20.0
MacOS
The text was updated successfully, but these errors were encountered: