Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
smoothdeveloper opened this issue Oct 22, 2023 · 3 comments · Fixed by #16175
Assignees
Labels
Area-Compiler-Checking Type checking, attributes and all aspects of logic checking Area-Diagnostics mistakes and possible improvements to diagnostics Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone

Comments

@smoothdeveloper
Copy link
Contributor

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.

@T-Gro
Copy link
Member

T-Gro commented Oct 23, 2023

This should give a better typechecking error about the missing member.
Should have been static membe Other() (without the instance pointer)

@T-Gro T-Gro self-assigned this Oct 23, 2023
@T-Gro T-Gro added Area-Diagnostics mistakes and possible improvements to diagnostics Area-Compiler-Checking Type checking, attributes and all aspects of logic checking Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. and removed Bug Needs-Triage labels Oct 23, 2023
@edgarfgp
Copy link
Contributor

Duplicate of #14316

@T-Gro
Copy link
Member

T-Gro commented Nov 2, 2023

Closing as duplicate.

@T-Gro T-Gro closed this as completed Nov 2, 2023
@github-project-automation github-project-automation bot moved this from Future to Done in F# Compiler and Tooling Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compiler-Checking Type checking, attributes and all aspects of logic checking Area-Diagnostics mistakes and possible improvements to diagnostics Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants