Commit Graph

1 Commits

Author SHA1 Message Date
Slava Pestov
4eec522578 Sema: Fix inheritance of @requires_stored_property_inits
Previously we would copy this attribute from a superclass to the
subclass when validating a subclass. However, this is only correct
if the superclass is always guaranteed to have been validated
before the subclass.

Indeed, it appears this assumption is no longer true, so we would
sometimes lose track of the attribute, which would result in SILGen
failing to emit the ivar initializer entry point.

Instead, check for the attribute as part of the superclass walk
in checkAncestry(), ensuring the result is always up to date, correct,
and cached.

As a follow-up, we should also convert checkAncestry() into a
request, but I'm not doing that here to keep the fix short.

Fixes <rdar://problem/50845438>.
2019-07-23 12:23:27 -04:00