Disallow conversion to super.

This commit is contained in:
chriseth
2020-12-01 14:15:50 +01:00
parent 6de7eaba95
commit 6d1454fce6
3 changed files with 23 additions and 0 deletions
+9
View File
@@ -2351,7 +2351,16 @@ bool TypeChecker::visit(FunctionCall const& _functionCall)
funcCallAnno.kind = FunctionCallKind::StructConstructorCall;
}
else
{
if (auto const* contractType = dynamic_cast<ContractType const*>(actualType))
if (contractType->isSuper())
m_errorReporter.fatalTypeError(
1744_error,
_functionCall.location(),
"Cannot convert to the super type."
);
funcCallAnno.kind = FunctionCallKind::TypeConversion;
}
funcCallAnno.isPure = argumentsArePure;