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

Compiler does not produce an error when one leaves out keyword "static" in an implementation of IWSAM. #14316

Closed
vzarytovskii opened this issue Nov 14, 2022 · 2 comments
Assignees
Labels
Area-Compiler-Checking Type checking, attributes and all aspects of logic checking Bug
Milestone

Comments

@vzarytovskii
Copy link
Member

This results in methodmissingexception in runtime.

Should be an easy fix.

@github-actions github-actions bot added this to the Backlog milestone Nov 14, 2022
@vzarytovskii vzarytovskii moved this to Not Planned in F# Compiler and Tooling Nov 14, 2022
@vzarytovskii vzarytovskii self-assigned this Nov 14, 2022
@vzarytovskii vzarytovskii added Area-Compiler-Checking Type checking, attributes and all aspects of logic checking Bug and removed Needs-Triage labels Nov 14, 2022
@vzarytovskii vzarytovskii modified the milestones: Backlog, November-2022 Nov 14, 2022
@vzarytovskii vzarytovskii changed the title Compiler does not oproduce an error when one leaves out keyword "static" in an implementation of IWSAM. Compiler does not produce an error when one leaves out keyword "static" in an implementation of IWSAM. Nov 14, 2022
@vzarytovskii vzarytovskii modified the milestones: December-2022, Backlog Jan 5, 2023
@edgarfgp
Copy link
Contributor

edgarfgp commented Jan 14, 2023

Is there any minimal repro for this issue ?

@En3Tho
Copy link
Contributor

En3Tho commented Jan 25, 2023

@edgarfgp

module StaticAbstractBug =
    type IOperation =
        static abstract member Execute: unit -> unit

    type FaultyOperation() =
        interface IOperation with
            member _.Execute() = () // no error

    type WorkingOperation() =
        interface IOperation with
            static member Execute() = ()

    let consume<'o when 'o :> IOperation>() ='o.Execute()

    let fail() = consume<WorkingOperation>()

// 7.0.102 sdk
// this is actually a different behavior than the one I've experienced before: build was successful and fail function was called but runtime error "Missing method" occured. I don't know ho to reproduce it now. Basically same as @vzarytovskii described
// "obj\Release\net7.0\refint\Bugs.dll": Error in pass3 for type Program, error: Error in pass3 for type StaticAbstractBug, error: Error in pass3 for type FaultyOperation, error: Error in GetMethodRefAsMethodDefIdx for mref = ("Execute", "IOperation"), error: MethodDefNotFound
StaticAbstractBug.fail()

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 Bug
Projects
Archived in project
Development

No branches or pull requests

3 participants