File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -299,44 +299,6 @@ extern (C++) final class TemplateDeclaration : ScopeDsymbol
299299 this .visibility = Visibility(Visibility.Kind.undefined);
300300 }
301301
302- extern (D ) void computeIsTrivialAlias(Dsymbol s)
303- {
304- /* Set isTrivialAliasSeq if this fits the pattern:
305- * template AliasSeq(T...) { alias AliasSeq = T; }
306- * or set isTrivialAlias if this fits the pattern:
307- * template Alias(T) { alias Alias = qualifiers(T); }
308- */
309- if (! (parameters && parameters.length == 1 ))
310- return ;
311-
312- auto ad = s.isAliasDeclaration();
313- if (! ad || ! ad.type)
314- return ;
315-
316- auto ti = ad.type.isTypeIdentifier();
317-
318- if (! ti || ti.idents.length != 0 )
319- return ;
320-
321- if (auto ttp = (* parameters)[0 ].isTemplateTupleParameter())
322- {
323- if (ti.ident is ttp.ident &&
324- ti.mod == 0 )
325- {
326- // printf("found isTrivialAliasSeq %s %s\n", s.toChars(), ad.type.toChars());
327- isTrivialAliasSeq = true ;
328- }
329- }
330- else if (auto ttp = (* parameters)[0 ].isTemplateTypeParameter())
331- {
332- if (ti.ident is ttp.ident)
333- {
334- // printf("found isTrivialAlias %s %s\n", s.toChars(), ad.type.toChars());
335- isTrivialAlias = true ;
336- }
337- }
338- }
339-
340302 override TemplateDeclaration syntaxCopy (Dsymbol)
341303 {
342304 // printf("TemplateDeclaration.syntaxCopy()\n");
Original file line number Diff line number Diff line change @@ -455,6 +455,44 @@ void computeOneMember(TemplateDeclaration td)
455455 }
456456}
457457
458+ private void computeIsTrivialAlias (TemplateDeclaration td, Dsymbol s)
459+ {
460+ /* Set isTrivialAliasSeq if this fits the pattern:
461+ * template AliasSeq(T...) { alias AliasSeq = T; }
462+ * or set isTrivialAlias if this fits the pattern:
463+ * template Alias(T) { alias Alias = qualifiers(T); }
464+ */
465+ if (! (td.parameters && td.parameters.length == 1 ))
466+ return ;
467+
468+ auto ad = s.isAliasDeclaration();
469+ if (! ad || ! ad.type)
470+ return ;
471+
472+ auto ti = ad.type.isTypeIdentifier();
473+
474+ if (! ti || ti.idents.length != 0 )
475+ return ;
476+
477+ if (auto ttp = (* td.parameters)[0 ].isTemplateTupleParameter())
478+ {
479+ if (ti.ident is ttp.ident &&
480+ ti.mod == 0 )
481+ {
482+ // printf("found isTrivialAliasSeq %s %s\n", s.toChars(), ad.type.toChars());
483+ td.isTrivialAliasSeq = true ;
484+ }
485+ }
486+ else if (auto ttp = (* td.parameters)[0 ].isTemplateTypeParameter())
487+ {
488+ if (ti.ident is ttp.ident)
489+ {
490+ // printf("found isTrivialAlias %s %s\n", s.toChars(), ad.type.toChars());
491+ td.isTrivialAlias = true ;
492+ }
493+ }
494+ }
495+
458496bool declareParameter (TemplateParameter _this, Scope* sc)
459497{
460498 static bool typeDeclareParameter (TemplateTypeParameter _this, Scope* sc)
You can’t perform that action at this time.
0 commit comments