Skip to content

[TypeReconstruction] Fix reconstruction for existential metatypes. #17184

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

Merged
merged 1 commit into from
Jun 14, 2018

Conversation

dcci
Copy link
Member

@dcci dcci commented Jun 13, 2018

Without this, we wouldn't be able to show an array of Any.Type
in the debugger.

Fixes rdar://problem/40940701.

@@ -6,4 +6,5 @@ $Ss10CollectionP7Element ---> Can't resolve type of $Ss10CollectionP7Element
$Ss15ContiguousArrayV9formIndex5afterySiz_tFSS_Tg5 ---> (inout Int) -> ()
$S12TypeReconstr8PatatinoaySiGD ---> Patatino<Int>
$S7ElementQzD ---> τ_0_0.Element
$S13EyeCandySwift21_previousUniqueNumber33_ADC08935D64EA4F796440E7335798735LLs6UInt64Vvp -> UInt64
$S13EyeCandySwift21_previousUniqueNumber33_ADC08935D64EA4F796440E7335798735LLs6UInt64Vvp ---> UInt64
Copy link
Member Author

Choose a reason for hiding this comment

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

While I was around, I also fixed this typo (of my own creation).

@dcci
Copy link
Member Author

dcci commented Jun 13, 2018

@swift-ci please test and merge


if (type_result.HasSingleType())
result._types.push_back(
ExistentialMetatypeType::get(type_result._types[0], metatype_repr));
Copy link
Contributor

Choose a reason for hiding this comment

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

Should you check that type_result._types is nonempty?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the non-emptiness it's already guaranteed as part of HasSingleType, which is defined as:

bool HasSingleType() { return _types.size() == 1 && _types.front(); }

Without this, we wouldn't be able to show an array of `Any.Type`
in the debugger.

Fixes <rdar://problem/40940701>.
@dcci dcci force-pushed the existentialmetareco branch from 230957e to ec40a54 Compare June 14, 2018 16:43
@dcci
Copy link
Member Author

dcci commented Jun 14, 2018

@swift-ci test and merge

@dcci
Copy link
Member Author

dcci commented Jun 14, 2018

@swift-ci please test and merge

@swift-ci swift-ci merged commit fc2f0a0 into swiftlang:master Jun 14, 2018
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.

4 participants