UserDefinedValueType: from simple name to canonical name.

This commit is contained in:
hrkrshnn
2021-09-15 12:56:29 +02:00
parent 0fa24c786b
commit de01822999
5 changed files with 28 additions and 25 deletions
+5
View File
@@ -341,6 +341,11 @@ Type const* UserDefinedValueTypeDefinition::type() const
return TypeProvider::typeType(TypeProvider::userDefinedValueType(*this));
}
TypeDeclarationAnnotation& UserDefinedValueTypeDefinition::annotation() const
{
return initAnnotation<TypeDeclarationAnnotation>();
}
Type const* StructDefinition::type() const
{
solAssert(annotation().recursive.has_value(), "Requested struct type before DeclarationTypeChecker.");
+2
View File
@@ -750,6 +750,8 @@ public:
Type const* type() const override;
TypeDeclarationAnnotation& annotation() const override;
TypeName const* underlyingType() const { return m_underlyingType.get(); }
bool isVisibleViaContractTypeAccess() const override { return true; }
+1 -1
View File
@@ -2555,7 +2555,7 @@ bool UserDefinedValueType::operator==(Type const& _other) const
string UserDefinedValueType::toString(bool /* _short */) const
{
return "user defined type " + definition().name();
return "user defined type " + *definition().annotation().canonicalName;
}
vector<tuple<string, Type const*>> UserDefinedValueType::makeStackItems() const