-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
TypeName parsing API #100094
TypeName parsing API #100094
Conversation
- allow ignoring errors (return null) - assembly name parsing
- report errorIndex in the ex message - fix Full Framework build - fix nested types support - implement NativeAOT part
… methods, move "allowFullyQualifiedName" to Options bag
…me and they are consistent with Sytem.Type APIs
… in test project and cover with tests, fix edge case bugs
…e API is complete
src/libraries/Common/src/System/Reflection/Metadata/AssemblyNameInfo.cs
Outdated
Show resolved
Hide resolved
src/libraries/Common/src/System/Reflection/AssemblyNameParser.cs
Outdated
Show resolved
Hide resolved
- don't throw TypeLoadException in the parser, let loader do that - add Debug.Assert(typeName.IsSimple) for clarity - always include invalid character index in the error message - remove resources added to CoreLib (they are never going to be used) - use [DoesNotReturn] and implement proper throw helper pattern - remove outdated comment about name validation - AssemblyNameInfo.Flags should return the exact value provided in ctor - don't allocate FullName until it's really needed - refactor Make and Resovle methods into one method - fix the test: specify namespace to make sure the type loader loads System.Int32 and later throws TypeLoadException for byref to byref
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
/backport to release/9.0-preview4 |
Started backporting to release/9.0-preview4: https://github.com/dotnet/runtime/actions/runs/8823414508 |
@jeffhandley backporting to release/9.0-preview4 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: TypeNameParser first ref and configurable input validation
Applying: assembly name parsing
Applying: initial generic type info parsing
Applying: decorator parsing
Applying: Handle single dimensional array indexing
Applying: implement TypeName.GetType
Applying: nested types support
Applying: support ignore case
Applying: integrate with System.Private.CoreLib:
Using index info to reconstruct a base tree...
M src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj
M src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
Falling back to patching base and 3-way merge...
Removing src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/TypeNameParser.cs
Auto-merging src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
Auto-merging src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj
Applying: integrate with System.Private.CoreLib:
Using index info to reconstruct a base tree...
M src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj
M src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
Falling back to patching base and 3-way merge...
Auto-merging src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
Removing src/coreclr/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.cs
Auto-merging src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj
Applying: integrate with System.Private.CoreLib for Mono and clr tools, improve perf
Applying: build fix 1/n
Applying: make TypeNameParser internal, extend TypeName with Parse and TryParse methods, move "allowFullyQualifiedName" to Options bag
Applying: introduce TotalComplexity
Applying: introduce FullName, so we have Name, FullName and AssemblyQualifiedName and they are consistent with Sytem.Type APIs
Applying: back tick error handling
Applying: move helper methods to a standalone helper type, include it as a link in test project and cover with tests, fix edge case bugs
Applying: increase test coverage, improve edge case handling
Applying: sample SerializationBinder that uses the new APIs
Applying: cover more serialization binder scenarios with the tests to ensure the API is complete
Applying: strict mode parsing: type names
Applying: strict mode parsing: assembly names
Applying: fix the build and apply some design changes
Applying: add escaping support
Applying: fix the last failing tests, increase test coverage, fix the perf, fix the build
Applying: apply changes based on the 1st API Design Review
Applying: apply changes based on the final API Design Review
Applying: solve the TODOs
Using index info to reconstruct a base tree...
M src/libraries/System.Private.CoreLib/src/Resources/Strings.resx
Falling back to patching base and 3-way merge...
Auto-merging src/libraries/System.Private.CoreLib/src/Resources/Strings.resx
CONFLICT (content): Merge conflict in src/libraries/System.Private.CoreLib/src/Resources/Strings.resx
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0028 solve the TODOs
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
@jeffhandley an error occurred while backporting to release/9.0-preview4, please check the run log for details! Error: git am failed, most likely due to a merge conflict. |
We're holding off on the backport for now. We may decide to proceed with it on Thursday though. |
@adamsitnik, as @TIHan mentioned, we have widespread test failures which seem to happen after this PR. Could you please take a quick look? CC @jeffhandley. |
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Likely caused improvements: |
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
fixes #97566
fixes #100867