Skip to content

[SymbolGraph] do not synthesize subclass methods #38240

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
Jul 12, 2021

Conversation

QuietMisdreavus
Copy link
Contributor

Resolves rdar://80091081

The current implementation for synthesizing subclass methods is inconsistent - it only works when the superclass is in the same module as the subclass. Since the �inheritsFrom relation already implies that all the superclass methods are available to the subclass, this PR removes the generation of synthesized subclass methods from the symbol graph entirely.

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please smoke test

public class Base {
public init() {}
public func foo() {}
}

public class Derived: Base {
// CHECK-DAG: "precise": "s:24SuperclassImplementation4BaseC3fooyyF::SYNTHESIZED::s:24SuperclassImplementation7DerivedC"
// CHECK-NOT: "precise": "s:24SuperclassImplementation4BaseC3fooyyF::SYNTHESIZED::s:24SuperclassImplementation7DerivedC"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we check that an inheritsFrom relationship exists instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The inheritsFrom relationship is already tested in the "SymbolGraph/Relationships/InheritsFrom" test.

@QuietMisdreavus QuietMisdreavus merged commit fd0e1e2 into main Jul 12, 2021
@QuietMisdreavus QuietMisdreavus deleted the QuietMisdreavus/no-subclass-synth branch July 12, 2021 14:18
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.

2 participants