diff options
| author | Yong He <yonghe@outlook.com> | 2017-12-27 20:17:36 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-27 20:17:36 -0500 |
| commit | e370fe2984e7e260dc2d78d67b087e542d0102b0 (patch) | |
| tree | dd441836025e802f79e74646f8f280c7515cbaec /source/slang/check.cpp | |
| parent | 69242398be1ba76898c0d6541eec3b7ca0ec1ab4 (diff) | |
| parent | d55b56bc804f25d8390f1dc6b09ff9116ffcaf29 (diff) | |
Merge pull request #335 from csyonghe/master
Support nested generic types (e.g. L<T<S>>)
Diffstat (limited to 'source/slang/check.cpp')
| -rw-r--r-- | source/slang/check.cpp | 14 |
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; |
