Skip to content

IRGen: The type layout of a metatype is not the same as the NativeObj… #14891

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

Conversation

aschwaighofer
Copy link
Contributor

…ect.Type

rdar://37924505

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@aschwaighofer
Copy link
Contributor Author

Hmm, maybe I can tighten this up more by distinguishing between ExistentialMetatypeType and MetatypeType.

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please smoke test

@swift-ci
Copy link
Contributor

swift-ci commented Mar 1, 2018

Build failed
Swift Test OS X Platform
Git Sha - a46346a

@swift-ci
Copy link
Contributor

swift-ci commented Mar 1, 2018

Build failed
Swift Test Linux Platform
Git Sha - a46346a

} else {
// Thick metatypes look like pointers with spare bits.
return emitFromValueWitnessTable(
CanMetatypeType::get(IGF.IGM.Context.TheNativeObjectType));
Copy link
Member

Choose a reason for hiding this comment

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

Should this just fall through, since the ObjC case below is the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I find conditional fall-throughs rather confusing. They have the potential issue that you could modify the code in the future that we fall through to in a way that is only meant for latter case (not the case we fall-through from) without realizing, similar when you add a case to the switch. Is this a likely scenario here? Maybe not.
Anyways, I defer to you.

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Mar 1, 2018

Build failed
Swift Test Linux Platform
Git Sha - 6d1c4b0

@swift-ci
Copy link
Contributor

swift-ci commented Mar 1, 2018

Build failed
Swift Test OS X Platform
Git Sha - 6d1c4b0

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.

3 participants