This repository was archived by the owner on Nov 1, 2020. It is now read-only.
Overhaul ToString in the type system#5065
Merged
MichalStrehovsky merged 1 commit intodotnet:masterfrom Dec 8, 2017
Merged
Conversation
This is fixing several problems with how we did `ToString`: * The existing scheme required every `TypeDesc`/`MethodDesc`/`FieldDesc` descendant to override `ToString`. Of course we were not consistent with this and as a result, most of our synthetic type system entities had non-existent representation in the debugger. Overriding is a lot of boilerplate. * We were not flexible with the stringified names. E.g. instantiated types became too long because we were module- and namespace- qualifying everything. * (Minor) The runtime type loader was shipping with ToString support in retail configuration that was largely unused. With the new scheme, besides fixing the problems above, I'm adding a bunch of conveniences: * `MethodDesc` now also have signatures in their `ToString`. * Well-known primitive types have short aliases * System.Private prefix is shortened to S.P. I tested that the `TYPE_LOADER_TRACE` still works after this. The runtime type loader overrides the `ToString` in all the places that matter.
Member
Author
|
@davidwrighton @jkotas @fadimounir please take a look |
jkotas
approved these changes
Dec 4, 2017
davidwrighton
approved these changes
Dec 8, 2017
MichalStrehovsky
added a commit
to MichalStrehovsky/corert
that referenced
this pull request
Jan 19, 2018
The full `ToString` implementation includes the signature to help diagnosability, but the runtime type loader might not be able to provide that information. Stop including MethodDesc.ToString.cs in the runtime type loader and restore old overrides on `MethodForInstantiatiatedType` and `InstantiatedMethod` that got deleted in dotnet#5065 (but only for the runtime type loader). Also fixing up the the project file: * The tracing options should also be available in CoreRT * Deleting `TYPE_SYSTEM_SINGLE_THREADED` that got introduced in TFS changeset 1553623 and got never used for anything
MichalStrehovsky
added a commit
that referenced
this pull request
Jan 19, 2018
The full `ToString` implementation includes the signature to help diagnosability, but the runtime type loader might not be able to provide that information. Stop including MethodDesc.ToString.cs in the runtime type loader and restore old overrides on `MethodForInstantiatiatedType` and `InstantiatedMethod` that got deleted in #5065 (but only for the runtime type loader). Also fixing up the the project file: * The tracing options should also be available in CoreRT * Deleting `TYPE_SYSTEM_SINGLE_THREADED` that got introduced in TFS changeset 1553623 and got never used for anything
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1276.
This is fixing several problems with how we did
ToString:TypeDesc/MethodDesc/FieldDescdescendant to overrideToString. Of course we were not consistent with this and as a result, most of our synthetic type system entities had non-existent representation in the debugger. Overriding is a lot of boilerplate.With the new scheme, besides fixing the problems above, I'm adding a bunch of conveniences:
MethodDescnow also have signatures in theirToString.I tested that the
TYPE_LOADER_TRACEstill works after this. The runtime type loader overrides theToStringin all the places that matter.