diff --git a/src/AssemblyGenerator.Attributes.cs b/src/AssemblyGenerator.Attributes.cs index 20187b7..2dcc2a5 100644 --- a/src/AssemblyGenerator.Attributes.cs +++ b/src/AssemblyGenerator.Attributes.cs @@ -55,7 +55,7 @@ static void EncodeLiteral(LiteralEncoder litEnc, CustomAttributeTypedArgument ar if (arg.Value is Type type) { // Type reference - litEnc.Scalar().SystemType(type.FullName); + litEnc.Scalar().SystemType(type.AssemblyQualifiedName); } else if (arg.Value is ReadOnlyCollection array) { @@ -162,4 +162,4 @@ static PrimitiveSerializationTypeCode PrimitiveTypeCodeFromSystemTypeCode(Type t throw new NotImplementedException($"Unsupported primitive type: {type}"); } } -} \ No newline at end of file +} diff --git a/src/Metadata/AssemblyMetadata.Types.cs b/src/Metadata/AssemblyMetadata.Types.cs index 0b63551..72b023c 100644 --- a/src/Metadata/AssemblyMetadata.Types.cs +++ b/src/Metadata/AssemblyMetadata.Types.cs @@ -24,7 +24,7 @@ public bool IsReferencedType(Type type) // todo, also maybe in Module, ModuleRef, AssemblyRef and TypeRef // ECMA-335 page 273-274 - return type.Assembly != SourceAssembly; + return !SourceAssembly.FullName.Equals(type.Assembly.FullName); } private EntityHandle ResolveTypeReference(Type type) @@ -141,4 +141,4 @@ private StringHandle GetNamespaceForType(Type type) return type.IsNested ? default : GetOrAddString(type.Namespace); } } -} \ No newline at end of file +}