Mercurial > projects > ddmd
comparison dmd/TemplateAliasParameter.d @ 13:427f8aa74d28
On the road to make Phobos compilable
author | korDen |
---|---|
date | Mon, 12 Apr 2010 16:29:33 +0400 |
parents | 89cc05dbdae1 |
children | 460959608115 |
comparison
equal
deleted
inserted
replaced
12:832f71e6f96c | 13:427f8aa74d28 |
---|---|
9 import dmd.Declaration; | 9 import dmd.Declaration; |
10 import dmd.MATCH; | 10 import dmd.MATCH; |
11 import dmd.OutBuffer; | 11 import dmd.OutBuffer; |
12 import dmd.HdrGenState; | 12 import dmd.HdrGenState; |
13 import dmd.Dsymbol; | 13 import dmd.Dsymbol; |
14 import dmd.TypeIdentifier; | |
15 import dmd.AliasDeclaration; | |
16 import dmd.Util; | |
14 | 17 |
15 import dmd.templates.Util; | 18 import dmd.templates.Util; |
16 | 19 |
17 class TemplateAliasParameter : TemplateParameter | 20 class TemplateAliasParameter : TemplateParameter |
18 { | 21 { |
50 return tp; | 53 return tp; |
51 } | 54 } |
52 | 55 |
53 void declareParameter(Scope sc) | 56 void declareParameter(Scope sc) |
54 { | 57 { |
55 assert(false); | 58 TypeIdentifier ti = new TypeIdentifier(loc, ident); |
59 sparam = new AliasDeclaration(loc, ident, ti); | |
60 if (!sc.insert(sparam)) | |
61 error(loc, "parameter '%s' multiply defined", ident.toChars()); | |
56 } | 62 } |
57 | 63 |
58 void semantic(Scope) | 64 void semantic(Scope sc) |
59 { | 65 { |
60 assert(false); | 66 if (specType) |
67 { | |
68 specType = specType.semantic(loc, sc); | |
69 } | |
70 specAlias = aliasParameterSemantic(loc, sc, specAlias); | |
71 static if (false) { // Don't do semantic() until instantiation | |
72 if (defaultAlias) | |
73 defaultAlias = defaultAlias.semantic(loc, sc); | |
74 } | |
61 } | 75 } |
62 | 76 |
63 void print(Object oarg, Object oded) | 77 void print(Object oarg, Object oded) |
64 { | 78 { |
65 assert(false); | 79 assert(false); |