Skip to content

Commit 1870673

Browse files
authored
Don't find witnesses for typars with conditional constraints, part 2 (#19246)
1 parent 2f7a17b commit 1870673

File tree

2 files changed

+394
-76
lines changed

2 files changed

+394
-76
lines changed

src/Compiler/Symbols/Exprs.fs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,13 @@ module FSharpExprConvert =
520520
let rec hasConditionalTypar ty =
521521
match stripTyEqns g ty with
522522
| TType_var (tp, _) -> tp.ComparisonConditionalOn || tp.EqualityConditionalOn
523-
| TType_app (_, tinst, _) -> tinst |> List.exists hasConditionalTypar
524-
| _ -> false
523+
| TType_app (_, tinst, _)
524+
| TType_ucase (_, tinst)
525+
| TType_anon (_, tinst)
526+
| TType_tuple (_, tinst) -> tinst |> List.exists hasConditionalTypar
527+
| TType_fun (domainTy, rangeTy, _) -> hasConditionalTypar domainTy || hasConditionalTypar rangeTy
528+
| TType_forall (_, bodyTy) -> hasConditionalTypar bodyTy
529+
| TType_measure _ -> false
525530

526531
let witnessExprs =
527532
match ConstraintSolver.CodegenWitnessesForTyparInst cenv.tcValF g cenv.amap m tps tyargs with

0 commit comments

Comments
 (0)