Skip to content

[Serialization] Public overrides of internal decls are ignorable by clients #63068

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
Jan 17, 2023

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Jan 17, 2023

Consider public overrides of internal decls as ignorable by clients. This change reflects the behavior of DeclAttribute.printImpl that prints the override keyword in a swiftinterface only when the overriden decl is also public.

This logic collaborates with deserialization safety that will reject loading the non-public overriden decl and raise an error, for which this change will make deserialization drop the error and keep the overriding decl.

This issue was detected when working on deserialization safety by public overrides of private functions in the following tests:

test/Interpreter/vtables_multifile.swift
test/Interpreter/vtables_multifile_testable.swift
test/SILGen/accessibility_vtables_testable.swift
test/SILGen/accessibility_vtables_usableFromInline.swift
test/SILGen/vtables_multifile.swift

…lients

This change reflects the behavior of `DeclAttribute.printImpl` that
prints the `override` keyword in a swiftinterface only when the
overriden decl is also public.

This issue was detected when working on deserialization safety by public
overrides of private functions in the following tests:

test/Interpreter/vtables_multifile.swift
test/Interpreter/vtables_multifile_testable.swift
test/SILGen/accessibility_vtables_testable.swift
test/SILGen/accessibility_vtables_usableFromInline.swift
test/SILGen/vtables_multifile.swift
@xymus xymus requested a review from bnbarham January 17, 2023 17:41
@xymus
Copy link
Contributor Author

xymus commented Jan 17, 2023

@swift-ci Please smoke test

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.

1 participant