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
{{ message }}
Repository navigation
Static abstract method on class or abstract class yields internal error #17044
Declaring a static abstract method on an abstract class fails with an internal error that does not surface in the tooling (VS or Ionide).
Repro steps
Define a static abstract member in an abstract class.
The tooling shows no errors, but attempting to build yields an internal error.
#nowarn"3535"[<AbstractClass>]typeA()=static abstractM :unit->unittypeB()=inherit A ()static memberM()= printfn "99"
B.M ()
error FS0193: internal error: Unable to load one or more of the requested types.
Virtual Static Method.
Virtual Static Method.
A similar error happens for regular classes:
#nowarn"3535"typeA()=static abstractM :unit->unit
error FS0193: internal error: Unable to load one or more of the requested types.
Abstract method in non-abstract class.
Expected behavior
I would expect an error message that explicitly disallowed static abstract methods in classes and abstract classes. I would also expect this message to show in the IDE.
Actual behavior
An internal error is raised in the compiler, and no error message is shown in the IDE.
Known workarounds
N/A.
Related information
This happens on current main (and probably earlier versions).
changed the title [-]Static abstract method on abstract class yields internal error[/-][+]Static abstract method on class or abstract class yields internal error[/+]on Apr 16, 2024
Activity
edgarfgp commentedon Apr 15, 2024
I think I have fix for this in a local branch somewhere 😅. Will try and raise a PR during the week if it is still available .
abonie commentedon Apr 15, 2024
Static abstract should be disallowed in abstract classes and only allowed in interfaces. But internal error is a bug for sure.
[-]Static abstract method on abstract class yields internal error[/-][+]Static abstract method on class or abstract class yields internal error[/+]