@@ -30,7 +30,6 @@ import dmd.dtemplate;
3030import dmd.enumsem;
3131import dmd.errors;
3232import dmd.expression;
33- import dmd.dsymbolsem : determineSize;
3433import dmd.hdrgen;
3534import dmd.id;
3635import dmd.identifier;
@@ -687,19 +686,6 @@ extern (C++) abstract class Type : ASTNode
687686 return false ;
688687 }
689688
690- /* *************************
691- * When T is mutable,
692- * Given:
693- * T a, b;
694- * Can we bitwise assign:
695- * a = b;
696- * ?
697- */
698- bool isAssignable ()
699- {
700- return true ;
701- }
702-
703689 /* *************************
704690 * Returns true if T can be converted to boolean value.
705691 */
@@ -3061,45 +3047,6 @@ extern (C++) final class TypeStruct : Type
30613047 return structinit;
30623048 }
30633049
3064- override bool isAssignable ()
3065- {
3066- bool assignable = true ;
3067- uint offset = ~ 0 ; // dead-store initialize to prevent spurious warning
3068-
3069- sym.determineSize(sym.loc);
3070-
3071- /* If any of the fields are const or immutable,
3072- * then one cannot assign this struct.
3073- */
3074- for (size_t i = 0 ; i < sym.fields.length; i++ )
3075- {
3076- VarDeclaration v = sym.fields[i];
3077- // printf("%s [%d] v = (%s) %s, v.offset = %d, v.parent = %s\n", sym.toChars(), i, v.kind(), v.toChars(), v.offset, v.parent.kind());
3078- if (i == 0 )
3079- {
3080- }
3081- else if (v.offset == offset)
3082- {
3083- /* If any fields of anonymous union are assignable,
3084- * then regard union as assignable.
3085- * This is to support unsafe things like Rebindable templates.
3086- */
3087- if (assignable)
3088- continue ;
3089- }
3090- else
3091- {
3092- if (! assignable)
3093- return false ;
3094- }
3095- assignable = v.type.isMutable() && v.type.isAssignable();
3096- offset = v.offset;
3097- // printf(" -> assignable = %d\n", assignable);
3098- }
3099-
3100- return assignable;
3101- }
3102-
31033050 override bool isBoolean ()
31043051 {
31053052 return false ;
@@ -3261,11 +3208,6 @@ extern (C++) final class TypeEnum : Type
32613208 return memType ().isString();
32623209 }
32633210
3264- override bool isAssignable ()
3265- {
3266- return memType ().isAssignable();
3267- }
3268-
32693211 override bool needsDestruction ()
32703212 {
32713213 return memType ().needsDestruction();
0 commit comments