mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Type checker: move the burden of computing mobile type to commonType
This solves #621
This commit is contained in:
parent
33590d513e
commit
6c15757618
@ -996,9 +996,9 @@ bool TypeChecker::visit(TupleExpression const& _tuple)
|
||||
fatalTypeError(components[i]->location(), "Invalid mobile type.");
|
||||
|
||||
if (i == 0)
|
||||
inlineArrayType = types[i]->mobileType();
|
||||
inlineArrayType = types[i];
|
||||
else if (inlineArrayType)
|
||||
inlineArrayType = Type::commonType(inlineArrayType, types[i]->mobileType());
|
||||
inlineArrayType = Type::commonType(inlineArrayType, types[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -200,10 +200,10 @@ TypePointer Type::commonType(TypePointer const& _a, TypePointer const& _b)
|
||||
{
|
||||
if (!_a || !_b)
|
||||
return TypePointer();
|
||||
else if (_b->isImplicitlyConvertibleTo(*_a))
|
||||
return _a;
|
||||
else if (_a->isImplicitlyConvertibleTo(*_b))
|
||||
return _b;
|
||||
else if (_b->isImplicitlyConvertibleTo(*_a->mobileType()))
|
||||
return _a->mobileType();
|
||||
else if (_a->isImplicitlyConvertibleTo(*_b->mobileType()))
|
||||
return _b->mobileType();
|
||||
else
|
||||
return TypePointer();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user