-
Notifications
You must be signed in to change notification settings - Fork 831
Closed
Labels
Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingType checking, attributes and all aspects of logic checkingBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Description
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>]
type A () =
static abstract M : unit -> unit
type B () =
inherit A ()
static member M () = 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"
type A () =
static abstract M : unit -> uniterror 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).
edgarfgp
Metadata
Metadata
Assignees
Labels
Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingType checking, attributes and all aspects of logic checkingBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Type
Projects
Status
Done