From 4b284daeb0cc3f6df0835befad4326c81abeb374 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 9 Jan 2018 13:26:42 -0800 Subject: Support nested generics fixes #362 --- source/slang/mangle.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source/slang/mangle.cpp') diff --git a/source/slang/mangle.cpp b/source/slang/mangle.cpp index 070c2b172..1a412d041 100644 --- a/source/slang/mangle.cpp +++ b/source/slang/mangle.cpp @@ -407,6 +407,22 @@ namespace Slang return context.sb.ProduceString(); } + String getMangledNameForConformanceWitness( + DeclRef sub, + Type* sup) + { + // The mangled form for a witness that `sub` + // conforms to `sup` will be named: + // + // {Conforms(sub,sup)} => _SW{sub}{sup} + // + ManglingContext context; + emitRaw(&context, "_SW"); + emitQualifiedName(&context, sub); + emitType(&context, sup); + return context.sb.ProduceString(); + } + String getMangledNameForConformanceWitness( Type* sub, Type* sup) -- cgit v1.2.3