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.");
|
fatalTypeError(components[i]->location(), "Invalid mobile type.");
|
||||||
|
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
inlineArrayType = types[i]->mobileType();
|
inlineArrayType = types[i];
|
||||||
else if (inlineArrayType)
|
else if (inlineArrayType)
|
||||||
inlineArrayType = Type::commonType(inlineArrayType, types[i]->mobileType());
|
inlineArrayType = Type::commonType(inlineArrayType, types[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -200,10 +200,10 @@ TypePointer Type::commonType(TypePointer const& _a, TypePointer const& _b)
|
|||||||
{
|
{
|
||||||
if (!_a || !_b)
|
if (!_a || !_b)
|
||||||
return TypePointer();
|
return TypePointer();
|
||||||
else if (_b->isImplicitlyConvertibleTo(*_a))
|
else if (_b->isImplicitlyConvertibleTo(*_a->mobileType()))
|
||||||
return _a;
|
return _a->mobileType();
|
||||||
else if (_a->isImplicitlyConvertibleTo(*_b))
|
else if (_a->isImplicitlyConvertibleTo(*_b->mobileType()))
|
||||||
return _b;
|
return _b->mobileType();
|
||||||
else
|
else
|
||||||
return TypePointer();
|
return TypePointer();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user