summaryrefslogtreecommitdiffstats
path: root/source/slang/check.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/check.cpp')
-rw-r--r--source/slang/check.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/slang/check.cpp b/source/slang/check.cpp
index 9faad1127..5141d8634 100644
--- a/source/slang/check.cpp
+++ b/source/slang/check.cpp
@@ -7003,8 +7003,18 @@ namespace Slang
}
}
- // TODO: need to fill in constraints here...
-
+ // create default substitution arguments for constraints
+ for (auto mm : genericDecl->Members)
+ {
+ if (auto genericTypeConstraintDecl = mm.As<GenericTypeConstraintDecl>())
+ {
+ RefPtr<DeclaredSubtypeWitness> witness = new DeclaredSubtypeWitness();
+ witness->declRef = makeDeclRef(genericTypeConstraintDecl.Ptr());
+ witness->sub = genericTypeConstraintDecl->sub.type;
+ witness->sup = genericTypeConstraintDecl->sup.type;
+ subst->args.Add(witness);
+ }
+ }
return subst;
}
return parentSubst;