Fix #8427: Promoted typeError to fatalTypeError in ReferencesResolver::endVisit(UserDefinedTypeName).

This commit is contained in:
a3d4 2020-03-24 03:43:07 +01:00
parent cfeea542b5
commit 339f3ca32c
4 changed files with 18 additions and 2 deletions

View File

@ -8,7 +8,8 @@ Compiler Features:
Bugfixes: Bugfixes:
* Inline Assembly: Fix internal error when accessing incorrect constant variables. * Inline Assembly: Fix internal error when accessing invalid constant variables.
* Reference Resolver: Fix internal error when accessing invalid struct members.
* Inheritance: Allow public state variables to override functions with dynamic memory types in their return values. * Inheritance: Allow public state variables to override functions with dynamic memory types in their return values.
* JSON AST: Always add pointer suffix for memory reference types. * JSON AST: Always add pointer suffix for memory reference types.

View File

@ -204,7 +204,7 @@ void ReferencesResolver::endVisit(UserDefinedTypeName const& _typeName)
else else
{ {
_typeName.annotation().type = TypeProvider::emptyTuple(); _typeName.annotation().type = TypeProvider::emptyTuple();
typeError(_typeName.location(), "Name has to refer to a struct, enum or contract."); fatalTypeError(_typeName.location(), "Name has to refer to a struct, enum or contract.");
} }
} }

View File

@ -0,0 +1,7 @@
contract C {
struct S {t t;}
function f(function(S memory) external) public {}
}
// ----
// TypeError: (25-26): Name has to refer to a struct, enum or contract.
// TypeError: (53-61): Internal type cannot be used for external function type.

View File

@ -0,0 +1,8 @@
contract C {
function f() public {}
struct S {f x;}
function g(function(S memory) external) public {}
}
// ----
// TypeError: (50-51): Name has to refer to a struct, enum or contract.
// TypeError: (78-86): Internal type cannot be used for external function type.