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

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

Closed
NinoFloris opened this issue Feb 8, 2020 · 2 comments
Closed

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

NinoFloris opened this issue Feb 8, 2020 · 2 comments
Labels
Bug Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone

Comments

@NinoFloris
Copy link
Contributor

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

@NinoFloris NinoFloris changed the title Internal error: couldn't remap internal tycon type Foo <> Internal error: couldn't remap internal tycon type Hober <> Feb 8, 2020
@cartermp cartermp added this to the Backlog milestone Feb 12, 2020
@dsyme
Copy link
Contributor

dsyme commented Aug 31, 2020

I've linked to this from #6805 as we should test w.r.t. that body of work

@dsyme dsyme added the Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code. label Aug 31, 2020
@dsyme
Copy link
Contributor

dsyme commented Sep 28, 2021

I don't repro the internal error any more with F# 5.0

@dsyme dsyme closed this as completed Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Projects
None yet
Development

No branches or pull requests

3 participants