Repository navigation
Labels
AI-thinks-issue-fixedArea-Compiler-SRTPbugs in SRTP inference, resolution, witness passing, code genBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Description
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
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.
Metadata
Metadata
Assignees
Labels
AI-thinks-issue-fixedArea-Compiler-SRTPbugs in SRTP inference, resolution, witness passing, code genBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.
Type
Projects
- StatusShow more project fieldsDone
Activity
dsyme commentedon Aug 8, 2020
Could you try with feature/ext?
github-actions commentedon Mar 19, 2026
🤖 This is an automated response from Repo Assist.
This bug appears to have been fixed in the current compiler. The repro code now compiles and runs correctly —
DuCaseName(Foo).Invoke Areturns"A"as expected.The issue itself noted "probably fixed by #9633". Looking at the related issue #9416 (a similar
FS0073: internal error: Undefined or unsolved type variablecase), that was closed as completed in January 2024. The SRTP improvements that went into the compiler (likely from the RFC FS-1043 work) appear to have resolved this class of bugs.Maintainers may want to close this issue.
auduchinok commentedon Mar 23, 2026
@T-Gro Let's add a test before closing the issue?
Add regression test for #9878: SRTP with phantom type parameter
Add regression test: #9878, SRTP with phantom type parameter (#19467)
Syncing release/dev18.6 with VS rel/insiders (#19699)