diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index e4aa399d8..464902971 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -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; diff --git a/test/libsolidity/syntaxTests/emit/emit_non_event.sol b/test/libsolidity/syntaxTests/emit/emit_non_event.sol index d5045ddf9..5f9053681 100644 --- a/test/libsolidity/syntaxTests/emit/emit_non_event.sol +++ b/test/libsolidity/syntaxTests/emit/emit_non_event.sol @@ -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. diff --git a/test/libsolidity/syntaxTests/functionCalls/int_not_callable.sol b/test/libsolidity/syntaxTests/functionCalls/int_not_callable.sol new file mode 100644 index 000000000..5ef2559be --- /dev/null +++ b/test/libsolidity/syntaxTests/functionCalls/int_not_callable.sol @@ -0,0 +1,8 @@ +contract C +{ + function f ( ) public { + var i = ( ( 1 ( 3 ) ) , 2 ); + } +} +// ---- +// TypeError: (61-68): Type is not callable diff --git a/test/libsolidity/syntaxTests/functionCalls/this_not_callable.sol b/test/libsolidity/syntaxTests/functionCalls/this_not_callable.sol new file mode 100644 index 000000000..dd32f2324 --- /dev/null +++ b/test/libsolidity/syntaxTests/functionCalls/this_not_callable.sol @@ -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 diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/492_do_not_crash_on_not_lvalue.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/492_do_not_crash_on_not_lvalue.sol index 902758049..2de7f4904 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/492_do_not_crash_on_not_lvalue.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/492_do_not_crash_on_not_lvalue.sol @@ -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(). diff --git a/test/libsolidity/syntaxTests/tupleAssignments/double_storage_crash.sol b/test/libsolidity/syntaxTests/tupleAssignments/double_storage_crash.sol index 3cff3a9a0..0e19136f4 100644 --- a/test/libsolidity/syntaxTests/tupleAssignments/double_storage_crash.sol +++ b/test/libsolidity/syntaxTests/tupleAssignments/double_storage_crash.sol @@ -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). diff --git a/test/libsolidity/syntaxTests/types/function_call_fail.sol b/test/libsolidity/syntaxTests/types/function_call_fail.sol index ef52ab448..5ce778a6d 100644 --- a/test/libsolidity/syntaxTests/types/function_call_fail.sol +++ b/test/libsolidity/syntaxTests/types/function_call_fail.sol @@ -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().