Type checker: move the burden of computing mobile type to commonType

This solves #621
This commit is contained in:
Yoichi Hirai
2016-11-11 15:51:54 +01:00
parent 33590d513e
commit 6c15757618
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -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();
}