Make the message about name not referring to a user-defined type more generic

This commit is contained in:
wechman 2022-08-01 10:42:58 +02:00 committed by Nikola Matic
parent c297183467
commit d5428af5bb
13 changed files with 13 additions and 13 deletions

View File

@ -190,7 +190,7 @@ void DeclarationTypeChecker::endVisit(UserDefinedTypeName const& _typeName)
m_errorReporter.fatalTypeError(
5172_error,
_typeName.location(),
"Name has to refer to a struct, enum or contract."
"Name has to refer to a user-defined type."
);
}
}

View File

@ -1,4 +1,4 @@
error E(uint);
function f(E x) pure returns (uint) {}
// ----
// TypeError 5172: (26-27): Name has to refer to a struct, enum or contract.
// TypeError 5172: (26-27): Name has to refer to a user-defined type.

View File

@ -9,4 +9,4 @@ contract C {
}
}
// ----
// TypeError 5172: (91-92): Name has to refer to a struct, enum or contract.
// TypeError 5172: (91-92): Name has to refer to a user-defined type.

View File

@ -4,4 +4,4 @@ contract C {
E x;
}
// ----
// TypeError 5172: (29-30): Name has to refer to a struct, enum or contract.
// TypeError 5172: (29-30): Name has to refer to a user-defined type.

View File

@ -6,4 +6,4 @@ contract C {
}
}
// ----
// TypeError 5172: (64-65): Name has to refer to a struct, enum or contract.
// TypeError 5172: (64-65): Name has to refer to a user-defined type.

View File

@ -2,4 +2,4 @@ contract C {
function ( uint ) external returns ( a [ ] calldata ) public a = ( 1 / 2 ) ;
}
// ----
// TypeError 5172: (58-59): Name has to refer to a struct, enum or contract.
// TypeError 5172: (58-59): Name has to refer to a user-defined type.

View File

@ -6,4 +6,4 @@ contract test {
}
}
// ----
// TypeError 5172: (77-80): Name has to refer to a struct, enum or contract.
// TypeError 5172: (77-80): Name has to refer to a user-defined type.

View File

@ -7,4 +7,4 @@ contract test {
}
}
// ----
// TypeError 5172: (77-80): Name has to refer to a struct, enum or contract.
// TypeError 5172: (77-80): Name has to refer to a user-defined type.

View File

@ -7,4 +7,4 @@ contract test {
}
}
// ----
// TypeError 5172: (85-88): Name has to refer to a struct, enum or contract.
// TypeError 5172: (85-88): Name has to refer to a user-defined type.

View File

@ -17,4 +17,4 @@ contract C {
// Warning 2519: (207-226): This declaration shadows an existing declaration.
// Warning 2519: (228-254): This declaration shadows an existing declaration.
// Warning 2519: (314-327): This declaration shadows an existing declaration.
// TypeError 5172: (104-114): Name has to refer to a struct, enum or contract.
// TypeError 5172: (104-114): Name has to refer to a user-defined type.

View File

@ -17,4 +17,4 @@ contract C {
// Warning 2519: (249-268): This declaration shadows an existing declaration.
// Warning 2519: (270-296): This declaration shadows an existing declaration.
// Warning 2519: (317-330): This declaration shadows an existing declaration.
// TypeError 5172: (124-134): Name has to refer to a struct, enum or contract.
// TypeError 5172: (124-134): Name has to refer to a user-defined type.

View File

@ -4,4 +4,4 @@ contract C {
function g(function(S memory) external) public {}
}
// ----
// TypeError 5172: (50-51): Name has to refer to a struct, enum or contract.
// TypeError 5172: (50-51): Name has to refer to a user-defined type.

View File

@ -4,4 +4,4 @@ contract C {
}
// ----
// TypeError 5172: (77-78): Name has to refer to a struct, enum or contract.
// TypeError 5172: (77-78): Name has to refer to a user-defined type.