Uh oh!
There was an error while loading. Please reload this page.
Don't find witnesses for typars with conditional constraints - #19123
Conversation
|
Smaug123
commented
Dec 2, 2025
I think this change doesn't need release notes; it's a pure bugfix. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Smaug123
commented
Dec 4, 2025
@T-Gro Thanks! I may just be incompetent with GitHub, but I can't find how to add the label that gets the release notes check to pass? |
Uh oh!
There was an error while loading. Please reload this page.
Description
Cope with conditional constraints in witness passing. See extensive inline comments for the reasoning.
The initial three commits were created by Claude Opus 4.5. I then reviewed it, in the process adding some fairly extensive docstrings (all docstrings and comments in this PR come from me, except the big one in the test file). My understanding of the witness generation code is still fairly limited, and I was relying on Opus to point me to the right places to understand it; I believe my mental model is coherent, but I'm still not completely sure that it's accurate.
If you would like to simply close this without review on grounds of LLM generation by a non-domain-expert then go for it, although I don't think I could do any better with my human brain.
Fixes#19118
For reference, additional context I gave Claude as well as the text of #19118
Here is the stack trace at the point where we set the "supports comparison" constraint on the type, which we eventually try to find a witness for (and apparently fail), if that helps; but I don't know where the bug actually comes from.🔴 TypedTree.Typar.SetConstraints() in FSharp.Compiler, FSharp.Compiler.Service.dll
◻ TypeHierarchy.FixupNewTypars@454.Invoke() in FSharp.Compiler, FSharp.Compiler.Service.dll
◻ ListModule.loop@248-3<FSharp.Compiler.TypedTree.Typar, FSharp.Compiler.TypedTree.Typar>() in Microsoft.FShar...
◻ ListModule.Iterate2<FSharp.Compiler.TypedTree.Typar, FSharp.Compiler.TypedTree.Typar>() in Microsoft.FShar...
◻ TypeHierarchy.FixupNewTypars() in FSharp.Compiler, FSharp.Compiler.Service.dll
◻ ConstraintSolver.FreshenAndFixupTypars() in FSharp.Compiler, FSharp.Compiler.Service.dll
◻ ConstraintSolver.FreshenTypeInst() in FSharp.Compiler, FSharp.Compiler.Service.dll
◻ ConstraintSolver.CodegenWitnessesForTyparInst() in FSharp.Compiler, FSharp.Compiler.Service.dll
🔴 FSharpExprConvert.GetWitnessArgs() in FSharp.Compiler.Symbols, FSharp.Compiler.Service.dll
◻ FSharpExprConvert.ConvModuleValueOrMemberUseLinear() in FSharp.Compiler.Symbols, FSharp.Compiler.Service.dll
◻ FSharpExprConvert.ConvExprOnDemand@1339.Invoke() in FSharp.Compiler.Symbols, FSharp.Compiler.Service.dll
◻ FSharpExpr.get_E() in FSharp.Compiler.Symbols, FSharp.Compiler.Service.dll
◻ FSharpExpr.get_ImmediateSubExpressions() in FSharp.Compiler.Symbols, FSharp.Compiler.Service.dll
◻ Line.go@44.Invoke() in CompilerDirectives, FSharp.Compiler.ComponentTests.dll [2]
◻ Line.go@44.Invoke() in CompilerDirectives, FSharp.Compiler.ComponentTests.dll [1]
◻ Line.demo of bug@22.MoveNext() in CompilerDirectives, FSharp.Compiler.ComponentTests.dll
Checklist
I believe release notes aren't necessary for this change, since it's purely a bugfix. I don't seem to be able to add labels, though?