Skip to content

Type inference fails #1742

@gusty

Description

@gusty

Type inference fails in this relatively simple scenario:

Repro steps

Write this:

type T = T with     
    static member        (+.) (T, x) = x : int    
    static member        (+.) (T, x) = x : string
    static member inline Add source = T +. source
    static member        (+.) (T, x) = x

Expected behavior

To compile, or at least type check

Actual behavior

~vs8323.fsx(4,41): error FS0001: This expression was expected to have type
    '_arg3    
but here has type
'b    

Known workarounds

Move the overload up

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions