Mercurial > projects > ddmd
comparison dmd/StructLiteralExp.d @ 135:af1bebfd96a4 dmd2037
dmd 2.038
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Mon, 13 Sep 2010 22:19:42 +0100 |
parents | 9e39c7de8438 |
children | 9a2a1ae6c8e5 |
comparison
equal
deleted
inserted
replaced
134:4251f96733f4 | 135:af1bebfd96a4 |
---|---|
155 v.scope_ = null; | 155 v.scope_ = null; |
156 } | 156 } |
157 } | 157 } |
158 else | 158 else |
159 { | 159 { |
160 e = v.type.defaultInit(Loc(0)); | 160 e = v.type.defaultInitLiteral(loc); |
161 e.loc = loc; | |
162 } | 161 } |
163 offset = v.offset + cast(uint)v.type.size(); | 162 offset = v.offset + cast(uint)v.type.size(); |
164 } | 163 } |
165 elements.push(e); | 164 elements.push(e); |
166 } | 165 } |
658 Type te = e.type; | 657 Type te = e.type; |
659 if (t.mod == 0) | 658 if (t.mod == 0) |
660 te = te.mutableOf(); | 659 te = te.mutableOf(); |
661 else | 660 else |
662 { | 661 { |
663 assert(t.mod == MODinvariant); | 662 assert(t.mod == MODimmutable); |
664 te = te.invariantOf(); | 663 te = te.invariantOf(); |
665 } | 664 } |
666 MATCH m2 = e.implicitConvTo(te); | 665 MATCH m2 = e.implicitConvTo(te); |
667 //printf("\t%s => %s, match = %d\n", e.toChars(), te.toChars(), m2); | 666 //printf("\t%s => %s, match = %d\n", e.toChars(), te.toChars(), m2); |
668 if (m2 < m) | 667 if (m2 < m) |