Skip to content

Internal error: couldn't remap internal tycon type Hober <> #8523

@NinoFloris

Description

@NinoFloris

While writing #8521 I came across this magnificent internal error while copying and editing some code:

type Foo = 
    static member Bar (x: int) = ()
    static member Bar (x: bool) = ()

    static member inline Invoke< ^N, 'a, 'b when (Foo or ^N): (static member Bar: 'a -> 'b)>  source = 
        let inline call (_: ^M, a) =
            ((^M or ^N): (static member Bar: _ -> _)(a))

        call (Unchecked.defaultof<Foo>, source)


type Hober = 
    static member Hoberator (x: int) = ()
    static member Hoberator (x: bool) = ()
    
    static member inline Invoke< ^N, 'a, 'b when (Hober or ^N): (static member Hoberator: 'a -> 'b)>  source = 
        let inline call (_: ^M, a) =
            ((^M or ^N): (static member Hoberator: _ -> _)(a))

        call (Unchecked.defaultof<Foo>, source)

    error FS0043: A type parameter is missing a constraint 'when (Foo or  ^N) : (static member Hoberator : '?1539481 -> '?1539482)'
    error FS0073: internal error: couldn't remap internal value 'Hoberator'
    error FS0073: internal error: couldn't remap internal value 'Hoberator'
    error FS0073: internal error: couldn't remap internal value 'Invoke'
    error FS0073: internal error: couldn't remap internal tycon type Hober <> =
      class
      end
      with
        Hoberator : int -> unit
                  ! compiled_name! =  Hoberator
                    membInfo-slotsig! =  []
                  # arity<0>[1]
        Hoberator : bool -> unit
                  ! compiled_name! =  Hoberator
                    membInfo-slotsig! =  []
                  # arity<0>[1]
        Invoke : !< ^_N when  ^_N : trait
                              ^_N : trait,'_a,'_b> '_?1539481 -> '_?1539482
               ! compiled_name! =  Invoke
                 membInfo-slotsig! =  []
               # arity<3>[1]
      end

Sharplab: https://sharplab.io/#v2:DYLgZgzgPgLgngBwKYAIBiB7DKC8KCwAUCiShDAIYwCWAxigLZIMBGSATigEIWcAUADxApqAOxgBKXCj4SipMpRr0mrDt14yhKFlmBS8sovNLkqdRszacxwMagCSogG4YA1kgA8KAHoA5ABoUAHIKIOCWFAB3AAskURlMbAxOfwlhPjNlSzVOHnZhUJQAWgA+EJYJcrIMAFd2WlQ8EwUSYCQYEVE7UVRaCmBgGQB9YR8AWSCKAxbWhT4+CZQU3z90mSyLVWsNApRhkvLhiT5puUJZhX7BmQBVUVo42g8AEwA6F6QwClrgGAwwJ4kqUghA6g0kOdjIR4MgUAAJDA7ZrEUxKLZWdSI6xUFaCYRiSTSIyokibFSYzjYji4/jaXQYfTE84KWbknI7Wz2FBOVwebz+cJhCrROIJPjUzgrNIZdnbLFImn/PZFMoVKpk8GNaSXUjtTpc3ooa5DPijXyTFDTXC6uYLJbStay9EU3IIxXsWnCA5q46nCRQ0mtE13B5PV4fL4/P4AoFYEE1eqNQNAA

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