Skip to content

Commit efae78e

Browse files
committed
Fix one more TODO
1 parent e33895c commit efae78e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/ReflectionMarker.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ internal void MarkTypeSystemEntity(in MessageOrigin origin, TypeSystemEntity ent
7171
MarkEvent(origin, @event, reason);
7272
break;
7373
// case InterfaceImplementation
74-
// Nothing to do currently as Native AOT will presere all interfaces on a preserved type
74+
// Nothing to do currently as Native AOT will preserve all interfaces on a preserved type
7575
}
7676
}
7777

@@ -83,6 +83,9 @@ internal bool TryResolveTypeNameAndMark(string typeName, in DiagnosticContext di
8383
TypeDesc foundType = System.Reflection.TypeNameParser.ResolveType(typeName, callingModule, diagnosticContext.Origin.MemberDefinition!.Context, referencedModules);
8484
if (foundType == null)
8585
{
86+
if (needsAssemblyName)
87+
diagnosticContext.AddDiagnostic(DiagnosticId.TypeWasNotFoundInAssemblyNorBaseLibrary, typeName);
88+
8689
type = default;
8790
return false;
8891
}

src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/AssemblyQualifiedNameDataflow.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,10 @@ static void TestConstructors ()
6060
RequireNothing (type);
6161
}
6262

63-
// NativeAOT doesn't implement this yet: https://github.com/dotnet/runtime/issues/72833
6463
[ExpectedWarning ("IL2105",
6564
"Type 'System.Invalid.TypeName' was not found in the caller assembly nor in the base library. " +
6665
"Type name strings used for dynamically accessing a type should be assembly qualified.",
67-
ProducedBy = Tool.Trimmer)]
66+
ProducedBy = Tool.Trimmer | Tool.NativeAot)]
6867
static void TestUnqualifiedTypeNameWarns ()
6968
{
7069
RequirePublicConstructors ("System.Invalid.TypeName");

0 commit comments

Comments
 (0)