Skip to content
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

Fix deserialization failure message of combined types #8558

Merged
merged 5 commits into from Dec 15, 2020

Conversation

Don-Vito
Copy link
Contributor

PR Checklist

Validation Steps Performed

Manual tests

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, for all of these except FontWeight, the boolean is not something I'd like to recommend to people. It's something we did for convenience, or something we did for compatibility (closeOnExit), but never recommended. I'd be more inclined to leave those ones alone.

For FontWeight, though. We're only adding the exception handling so that we can call our local TypeDescription, right?

It seems like FlagMapper and EnumMapper should just use TBase::TypeDescription. That will let them automatically get the derived type's description with automatic rollup to the parent's implementation. That way, you don't need to catch/rethrow/etc. 😄

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Dec 11, 2020
@DHowett DHowett removed their assignment Dec 11, 2020
@Don-Vito
Copy link
Contributor Author

So, for all of these except FontWeight, the boolean is not something I'd like to recommend to people. It's something we did for convenience, or something we did for compatibility (closeOnExit), but never recommended. I'd be more inclined to leave those ones alone.

For FontWeight, though. We're only adding the exception handling so that we can call our local TypeDescription, right?

It seems like FlagMapper and EnumMapper should just use TBase::TypeDescription. That will let them automatically get the derived type's description with automatic rollup to the parent's implementation. That way, you don't need to catch/rethrow/etc. 😄

Actually, I wanted to make TypeDescription virtual. Do you see any problem with this?

@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Dec 11, 2020
@DHowett
Copy link
Member

DHowett commented Dec 11, 2020

I'd rather we not do that -- right now it all compiles down to free immediate dispatch without vtable lookups... and we're not particularly helped by making it virtual (since there's workarounds here.)

The converter type never changes at runtime, which is the big thing virtual would let us do.

@Don-Vito
Copy link
Contributor Author

I'd rather we not do that -- right now it all compiles down to free immediate dispatch without vtable lookups... and we're not particularly helped by making it virtual (since there's workarounds here.)

The converter type never changes at runtime, which is the big thing virtual would let us do.

Yeah. Makes sense. That is why I avoided it in the first place. 😊
I will try to call TBase.

@Don-Vito
Copy link
Contributor Author

@DHowett - any reason TypeDescription is not static? I mean I can always do something like:

e.expectedType = static_cast<const TBase&>(*this).TypeDescription();

or to convert this method to static.

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this. Yeah, static thing is weird. I'm interested in cleaning up JsonUtils a little in the future, too. Got a couple todo list items in there 😄

Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, seems cool to me. Thanks!

@zadjii-msft
Copy link
Member

I'm gonna tag in @DHowett to massage the commit message and make sure that the build doesn't break on merging main

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@DHowett DHowett merged commit da6705c into microsoft:main Dec 15, 2020
@ghost
Copy link

ghost commented Jan 28, 2021

🎉Windows Terminal Preview v1.6.10272.0 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants