Skip to content

Build fails with Error FS2014 when a signature file is used with IWSAMs #16329

@jrharnden

Description

@jrharnden

This appears to be directly related to #15919. The fix identified by @vzarytovskii and implemented by @gusty works for the scenario below when there is no signature file. When a signature file is added it still triggers the error. The types do not even need to be in the signature file to trigger the error.

Error:

A problem occurred writing the binary 'obj\Debug\net7.0\refint\Foo.dll': Error in pass3 for type Foo, error: Error in pass3 for type CompilerGoesBoom1, error: Error in GetMethodRefAsMethodDefIdx for mref = ("Foo.IHasStaticAbstractBase<'a>.Boom", "CompilerGoesBoom1"), error: MethodDefNotFound

Scenario identified by @En3Tho:

type IHasStaticAbstractBase<'a> =
    static abstract Boom: unit -> 'a

type IHasStaticAbstractChild<'a> =
    inherit IHasStaticAbstractBase<'a>

type CompilerGoesBoom<'a>() =
    interface IHasStaticAbstractChild<'a> with // this goes boom because inheritance is involved
        static member Boom() = Unchecked.defaultof<'a>

type CompilerDoesNotGoBoom<'a>() =
    interface IHasStaticAbstractBase<'a> with // this does not go boom, direct base interface
        static member Boom() = Unchecked.defaultof<'a>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions