Diagnose an invalid use of non-polymorphic constructors#13351
Diagnose an invalid use of non-polymorphic constructors#13351slavapestov merged 3 commits intoswiftlang:masterfrom
Conversation
|
@swift-ci Please smoke test |
|
Seems like we'd need to downgrade this to a warning in Swift 4 mode. |
|
Build failed |
|
@jrose-apple Here is a reduced version of the example from SILGen/protocol_extensions.swift: The code compiles successfully with asserts off but the print() prints out a metatype and not an instance as expected. So it's just encountering undefined behavior. If I remove the @objc, I get a bus error instead. I don't think keeping this as a warning is a good idea, since there's no vtable entry for the initializer in this case and it's unlikely anyone is relying on this with good results. |
…etype This is a corner case but would previously lead to a compiler crash or miscompile. Fixes <rdar://problem/21991470>, <https://bugs.swift.org/browse/SR-5022>.
54de9a0 to
336a97b
Compare
|
@swift-ci Please smoke test |
|
@swift-ci Please test source compatibility |
|
Build failed |
|
Hm, okay, fair enough. |
Fixes rdar://problem/21991470, https://bugs.swift.org/browse/SR-5022.