Skip to content

type check internal error for interface with static abstract member that is implemented as instance member #16156

@smoothdeveloper

Description

@smoothdeveloper

Reported by @pblasucci.

type IFoo<'T> =
   abstract DoIt: unit -> string
   static abstract Other : int -> int
type MyFoo = {
   Value : int
} with
  interface IFoo<MyFoo> with
    member me.DoIt() = string me.Value
    member _.Other(value) = value + 1

Actual behavior

error FS0193: internal error: Unable to load one or more of the requested types.
Method not found: 'Int32 IFoo`1.Other(Int32)'.

Expected behavior

For now, suggesting to default to the existing message for missing override:

error FS0855: No abstract or interface member was found that corresponds to this override

It could also be more explicit about the member existing but not being defined as static.

Metadata

Metadata

Assignees

Labels

Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingArea-Diagnosticsmistakes and possible improvements to diagnosticsBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions