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

Undefined or unsolved type variable #9878

Open
NinoFloris opened this issue Aug 5, 2020 · 1 comment
Open

Undefined or unsolved type variable #9878

NinoFloris opened this issue Aug 5, 2020 · 1 comment
Labels
Area-Compiler-SRTP bugs in SRTP inference, resolution, witness passing, code gen Bug Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone

Comments

@NinoFloris
Copy link
Contributor

Running on 5.0 preview 8, probably fixed by #9633

type DuCaseName<'T> =
    static member ToCaseName<'t, 'u>(value: 't) =
        failwith "just here to provide delayed resolution"
    static member ToCaseName(value: 'T) =
        match FSharp.Reflection.FSharpValue.GetUnionFields(value, typeof<'T>) with
        | case, _ -> case.Name

    static member inline Invoke(value: 'a) =
        let inline call (other: ^M, value: ^I) = ((^M or ^I) : (static member ToCaseName: ^I -> string) value)
        call (Unchecked.defaultof<DuCaseName<'T>>, value)

error FS0073: internal error: Undefined or unsolved type variable: '_?2272016

https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA0AbEAzAzgHwBcBPABxgAIARAVwGEBDXGAOQYFsYAeAcgBUAfBQC8AWABQFKRVyEGhAJZgKndsBhQKfCI2ZtOvQmgo8aAgBQA3BhhowQJwgEoRE6e4rYGCjAHcFhAAWFABEAFY0shSBGpSEEBSkUBCWCgAmlBkYDMQwaRSwuBC2ihAAdiFu0rLySiowahpaOkysHDBWNnYO/C5ikh5S7PJgwQBiAMqBDFCkAHQASjDYGDBgpWVzk9OzAGpdMHMA4jCEAKplCuVjCjAYabidtjDGJOQQ2LyCLv5BVYP4ChgVrGAD6FDgQmBzDm+hgEn+MjkimUqnUmgUZQwmMoAEkypYIABrDrWZ49Bh9RHuVaECiY7FlSjAjAYCjmCBBDQOAB6AFljGTuhQebi+uzzPyKNARWKKA5zDUUfVGpptLo2pxebiIUJZFBMQBzFxCmBOanSFls8wXUZrElpOYZLw0DDxT60DVwr4CASCg5OIA

    static member ToCaseName<'t, 'u>(value: 't) =
        failwith "just here to provide delayed resolution"

The phantom 'u seems to be the culprit in this instance.

@dsyme
Copy link
Contributor

dsyme commented Aug 8, 2020

Could you try with feature/ext?

@cartermp cartermp added this to the Backlog milestone Aug 22, 2020
@dsyme dsyme added the Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. label Aug 26, 2020
@dsyme dsyme added Area-Compiler-SRTP bugs in SRTP inference, resolution, witness passing, code gen and removed Area-Compiler labels Mar 31, 2022
@vzarytovskii vzarytovskii moved this to Not Planned in F# Compiler and Tooling Jun 17, 2022
@vzarytovskii vzarytovskii added Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code. and removed Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. labels May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compiler-SRTP bugs in SRTP inference, resolution, witness passing, code gen Bug Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Projects
Status: New
Development

No branches or pull requests

4 participants