mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #8313 from ethereum/checkFunctionsExistInIsoltest
Make type error fatal to prevent assert failure at later point
This commit is contained in:
commit
c635377450
@ -2154,7 +2154,7 @@ bool TypeChecker::visit(FunctionCall const& _functionCall)
|
|||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
m_errorReporter.typeError(_functionCall.location(), "Type is not callable");
|
m_errorReporter.fatalTypeError(_functionCall.location(), "Type is not callable");
|
||||||
funcCallAnno.kind = FunctionCallKind::Unset;
|
funcCallAnno.kind = FunctionCallKind::Unset;
|
||||||
funcCallAnno.isPure = argumentsArePure;
|
funcCallAnno.isPure = argumentsArePure;
|
||||||
break;
|
break;
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
contract C {
|
contract C {
|
||||||
uint256 Test;
|
function() Test;
|
||||||
|
|
||||||
function f() public {
|
function f() public {
|
||||||
emit Test();
|
emit Test();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// TypeError: (63-69): Type is not callable
|
// TypeError: (66-70): Expression has to be an event invocation.
|
||||||
// TypeError: (63-67): Expression has to be an event invocation.
|
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
contract C
|
||||||
|
{
|
||||||
|
function f ( ) public {
|
||||||
|
var i = ( ( 1 ( 3 ) ) , 2 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError: (61-68): Type is not callable
|
@ -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
|
@ -7,5 +7,3 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// TypeError: (153-157): Type is not callable
|
// 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().
|
|
||||||
|
@ -8,4 +8,3 @@ contract CrashContract {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// TypeError: (170-177): Type is not callable
|
// 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).
|
|
||||||
|
@ -5,5 +5,3 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// TypeError: (59-63): Type is not callable
|
// 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().
|
|
||||||
|
Loading…
Reference in New Issue
Block a user