diff options
| author | Yong He <yonghe@outlook.com> | 2018-03-06 16:12:37 -0500 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-03-06 13:12:37 -0800 |
| commit | ed718ba1048ef856efbf0d02902e4d60f173b207 (patch) | |
| tree | 44c4778d5582dfb99e0fb228af49bd1e0e8b8cf6 /source | |
| parent | 1fef9b4abfce5ace686a6acc772c605503f825fd (diff) | |
Add a case to `TryUnifyVals` to cover `SubtypeWitness` vals (#435)
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/check.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/slang/check.cpp b/source/slang/check.cpp index 40461d0a3..f7cb3b575 100644 --- a/source/slang/check.cpp +++ b/source/slang/check.cpp @@ -5149,6 +5149,20 @@ namespace Slang } } + if (auto fstWit = fst.As<DeclaredSubtypeWitness>()) + { + if (auto sndWit = snd.As<DeclaredSubtypeWitness>()) + { + auto constraintDecl1 = fstWit->declRef.As<TypeConstraintDecl>(); + auto constraintDecl2 = sndWit->declRef.As<TypeConstraintDecl>(); + assert(constraintDecl1); + assert(constraintDecl2); + return TryUnifyTypes(constraints, + constraintDecl1.getDecl()->getSup().type, + constraintDecl2.getDecl()->getSup().type); + } + } + throw "unimplemented"; // default: fail |
