From ed718ba1048ef856efbf0d02902e4d60f173b207 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 6 Mar 2018 16:12:37 -0500 Subject: Add a case to `TryUnifyVals` to cover `SubtypeWitness` vals (#435) --- source/slang/check.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source') 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()) + { + if (auto sndWit = snd.As()) + { + auto constraintDecl1 = fstWit->declRef.As(); + auto constraintDecl2 = sndWit->declRef.As(); + assert(constraintDecl1); + assert(constraintDecl2); + return TryUnifyTypes(constraints, + constraintDecl1.getDecl()->getSup().type, + constraintDecl2.getDecl()->getSup().type); + } + } + throw "unimplemented"; // default: fail -- cgit v1.2.3