Merge pull request #8313 from ethereum/checkFunctionsExistInIsoltest

Make type error fatal to prevent assert failure at later point
This commit is contained in:
Mathias L. Baumann 2020-02-13 16:08:13 +01:00 committed by GitHub
commit c635377450
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 9 deletions

View File

@ -2154,7 +2154,7 @@ bool TypeChecker::visit(FunctionCall const& _functionCall)
}
default:
m_errorReporter.typeError(_functionCall.location(), "Type is not callable");
m_errorReporter.fatalTypeError(_functionCall.location(), "Type is not callable");
funcCallAnno.kind = FunctionCallKind::Unset;
funcCallAnno.isPure = argumentsArePure;
break;

View File

@ -1,10 +1,9 @@
contract C {
uint256 Test;
function() Test;
function f() public {
emit Test();
}
}
// ----
// TypeError: (63-69): Type is not callable
// TypeError: (63-67): Expression has to be an event invocation.
// TypeError: (66-70): Expression has to be an event invocation.

View File

@ -0,0 +1,8 @@
contract C
{
function f ( ) public {
var i = ( ( 1 ( 3 ) ) , 2 );
}
}
// ----
// TypeError: (61-68): Type is not callable

View File

@ -0,0 +1,9 @@
contract C {
function f() public returns (uint, uint) {
try this() {
} catch Error(string memory) {
}
}
}
// ----
// TypeError: (72-78): Type is not callable

View File

@ -7,5 +7,3 @@ contract C {
}
// ----
// TypeError: (153-157): Type is not callable
// TypeError: (153-157): Expression has to be an lvalue.
// TypeError: (160-161): Type int_const 2 is not implicitly convertible to expected type tuple().

View File

@ -8,4 +8,3 @@ contract CrashContract {
}
// ----
// TypeError: (170-177): Type is not callable
// TypeError: (170-177): Type tuple() is not implicitly convertible to expected type tuple(struct CrashContract.S storage ref,struct CrashContract.S storage ref).

View File

@ -5,5 +5,3 @@ contract C {
}
// ----
// TypeError: (59-63): Type is not callable
// TypeError: (59-63): Expression has to be an lvalue.
// TypeError: (67-68): Type int_const 2 is not implicitly convertible to expected type tuple().