Skip to content

Members using overloaded operators defined over member's containing type require unsatisfiable constraint #968

@drvink

Description

@drvink
type hoop< ^a when ^a : (static member (+) : ^a * ^a -> ^a) > = {
  Group1 : ^a;
  Group2 : ^a
} with
  static member inline (+) (x, y) = x.Group1 + y.Group2
end

let z = { Group1 = 1; Group2 = 2 } + { Group1 = 2; Group2 = 3 } // ok

type hoop with
  member inline this.Sum = this.Group1 + this.Group2 // A type parameter is missing a constraint 'when ( ^a or  ^?104290) : (static member ( + ) :  ^a *  ^?104290 ->  ^?104291)'
end

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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions