Allow Mapping keys to have type UserDefinedValueType.

Also added syntax and semantic test.
This commit is contained in:
hrkrshnn
2021-09-13 10:03:49 +02:00
parent 952540c3b5
commit 1fa6c71bd0
6 changed files with 27 additions and 4 deletions
@@ -253,12 +253,13 @@ void DeclarationTypeChecker::endVisit(Mapping const& _mapping)
{
case Type::Category::Enum:
case Type::Category::Contract:
case Type::Category::UserDefinedValueType:
break;
default:
m_errorReporter.fatalTypeError(
7804_error,
typeName->location(),
"Only elementary types, contract types or enums are allowed as mapping keys."
"Only elementary types, user defined value types, contract types or enums are allowed as mapping keys."
);
break;
}