diff options
| author | Ronan <ro.cailleau@gmail.com> | 2025-04-26 21:04:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-26 12:04:01 -0700 |
| commit | a5efbb1b775afb2f6b29b37d39947c41744bb005 (patch) | |
| tree | ae5c1e11544d2411816ee6fcfb29b2820d41fcb0 /source/slang/slang-mangle.cpp | |
| parent | d84aeeffdba388aec7a781c35973bf404d37fe80 (diff) | |
Added getCanonicalGenericConstraints2 (sorts constraints and allows more generic expressions) (#6787)
Diffstat (limited to 'source/slang/slang-mangle.cpp')
| -rw-r--r-- | source/slang/slang-mangle.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source/slang/slang-mangle.cpp b/source/slang/slang-mangle.cpp index f5878cb1d..aa30eef9d 100644 --- a/source/slang/slang-mangle.cpp +++ b/source/slang/slang-mangle.cpp @@ -576,14 +576,23 @@ void emitQualifiedName(ManglingContext* context, DeclRef<Decl> declRef, bool inc } auto canonicalizedConstraints = - getCanonicalGenericConstraints(context->astBuilder, parentGenericDeclRef); + getCanonicalGenericConstraints2(context->astBuilder, parentGenericDeclRef); for (auto& constraint : canonicalizedConstraints) { - for (auto type : constraint.value) + if (constraint.value.getCount() > 0) { emitRaw(context, "C"); - emitQualifiedName(context, makeDeclRef(constraint.key), true); - emitType(context, type); + emitType(context, constraint.key); + int counter = 0; + for (auto type : constraint.value) + { + if (counter > 0) + { + emitRaw(context, "_"); + } + ++counter; + emitType(context, type); + } } } } |
