Skip to content

Conversation

nkcsgexi
Copy link
Contributor

New ABIs should have an @available attribute to describe the introducing version. This patch teaches the tool to diagnose its missing.

Decls with @_AlwaysEmitIntoClient are excluded from the blaming lists since they are essentially available all the time.

Thanks for the inputs from @lorentey and @jrose-apple !

rdar://51089418

…ns in error messages

External type declarations are synthesized to incorporate members in extensions to types
of external modules. In diagnostics, we should use 'extension' instead of 'struct/class'
for these decls to avoid confusion.
@nkcsgexi
Copy link
Contributor Author

@swift-ci please smoke test

// Diagnose the missing of @available attributes.
// Decls with @_alwaysEmitIntoClient aren't required to have an
// @available attribute.
if (D->getIntroducingVersion().empty() &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Swift availability doesn't count as OS availability.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will Fix!

…ABIs

New ABIs should have an @available attribute to describe the introducing
version. This patch teaches the tool to diagnose its missing.

Decls with @_AlwaysEmitIntoClient are excluded from the blaming lists since
they are essentially available all the time.

rdar://51089418
@nkcsgexi nkcsgexi force-pushed the synthesized-type-as-extension branch from 7b5e9f2 to f55d3ad Compare May 28, 2019 23:39
@nkcsgexi
Copy link
Contributor Author

@swift-ci please smoke test

For frameworks not shipping with OSs, the users should specify this flag
to avoid diagnosing some changes, such as the missing of OS availability
attributes.
@nkcsgexi
Copy link
Contributor Author

@swift-ci please smoke test

…are enabled

We started to diagnose new APIs such as the missing of @available attributes. This diverges
the expected change lists for builds with/without assertions enabled because some stdlib
symbols are included only when asserts are enabled. We start to require
asserts here to make sure the test doesn't fail on no-assertion settings.
@nkcsgexi
Copy link
Contributor Author

@swift-ci please smoke test

@@ -1,4 +1,5 @@
// REQUIRES: OS=macosx
// REQUIRES: asserts
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems very dangerous. Can we have a with-asserts and a without-asserts variant, and say that the dump has to match one of them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It sounds like a good idea. I'll add another test requires no asserts

Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be easiest to keep them in sync if we assume the with-asserts variant is a superset. Then it can just use the cat of the two files as the expected changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just split the expected changes to two lists: one without asserts and the other the additional blames when asserts are enabled. The asserts-enabled test will diff against the combination of both.

@nkcsgexi
Copy link
Contributor Author

@swift-ci please smoke test

@nkcsgexi nkcsgexi force-pushed the synthesized-type-as-extension branch from 90f8498 to de1718e Compare May 30, 2019 21:58
@nkcsgexi
Copy link
Contributor Author

@swift-ci please smoke test

@nkcsgexi nkcsgexi merged commit 46b5af5 into swiftlang:master May 30, 2019
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