Merge pull request #11939 from ethereum/userdefined-types-mapping-key

Allow Mapping keys to have type UserDefinedValueType.
This commit is contained in:
Harikrishnan Mulackal
2021-09-13 15:06:14 +02:00
committed by GitHub
9 changed files with 158 additions and 16 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;
}