swift
70d903e9 - SILGen: Strip off DynamicSelfType when tranforming values

Commit
6 years ago
SILGen: Strip off DynamicSelfType when tranforming values We lower away a top-level DynamicSelfType, so let's just strip them off before trying the other conversions. For now this is NFC, but we can end up here after the next patch. Even then we shouldn't end up here except when emitting protocol witnesses. The relevant case is when a base class method (return @dynamic_self Base) is used by a derived class to witness a requirement on a protocol (which returns @dynamic_self Derived since its a derived class conformance). In this case, we know both values have the same type, but the lowered types are $Base and $Derived, respectively, so we must emit an unchecked downcast.
Author
Committer
Parents
Loading