-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Use SRM's TypeName parser in ILLink #103740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -37,6 +37,7 @@ class LinkedMethodEntity : LinkedEntity | |||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| private readonly BaseAssemblyResolver originalsResolver; | ||||||||||||||||||
| private readonly TypeNameResolver originalsTypeNameResolver; | ||||||||||||||||||
| private readonly ReaderParameters originalReaderParameters; | ||||||||||||||||||
| private readonly AssemblyDefinition originalAssembly; | ||||||||||||||||||
| private readonly TrimmedTestCaseResult testResult; | ||||||||||||||||||
|
|
@@ -69,6 +70,7 @@ public AssemblyChecker ( | |||||||||||||||||
| TrimmedTestCaseResult testResult) | ||||||||||||||||||
| { | ||||||||||||||||||
| this.originalsResolver = originalsResolver; | ||||||||||||||||||
| this.originalsTypeNameResolver = new TypeNameResolver (new TestResolver (), new TestAssemblyNameResolver (originalsResolver)); | ||||||||||||||||||
| this.originalReaderParameters = originalReaderParameters; | ||||||||||||||||||
| this.originalAssembly = original; | ||||||||||||||||||
| this.testResult = testResult; | ||||||||||||||||||
|
|
@@ -1468,7 +1470,9 @@ internal IEnumerable<string> VerifyLinkingOfOtherAssemblies (AssemblyDefinition | |||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| var expectedTypeName = checkAttrInAssembly.ConstructorArguments[1].Value.ToString ()!; | ||||||||||||||||||
| var expectedType = originalTargetAssembly.MainModule.GetType(expectedTypeName); | ||||||||||||||||||
| if (!originalsTypeNameResolver.TryResolveTypeName (originalTargetAssembly, expectedTypeName, out TypeReference? expectedTypeRef, out _)) | ||||||||||||||||||
| Assert.Fail($"Could not resolve original type `{expectedTypeName}' in assembly {assemblyName}"); | ||||||||||||||||||
| TypeDefinition expectedType = expectedTypeRef.Resolve (); | ||||||||||||||||||
|
Comment on lines
+1473
to
+1475
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Append to the errs list rather than failing immediately.
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather keep this one as an assert because it indicates a test authoring issue, and this matches what we do in some other places that fail to resolve something from the input. |
||||||||||||||||||
| linkedMembersInAssembly.TryGetValue(new AssemblyQualifiedToken(expectedType), out LinkedEntity? linkedTypeEntity); | ||||||||||||||||||
| MetadataType? linkedType = linkedTypeEntity?.Entity as MetadataType; | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.