-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Allow @usableFromInline and @inlinable to package decls #64408
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
Conversation
@@ -1,3 +1,4 @@ | |||
// RUN: %target-typecheck-verify-swift -package-name myPkg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding this back (removed in the previous PR); changes to the existing tests in this file are needed to match the original (before the PR)
@swift-ci smoke test |
Add tests for packgae inline Add more package acl tests Resolves rdar://104617133
@swift-ci smoke test |
@swift-ci smoke test |
WARNING(protocol_usable_from_inline_warn,none, | ||
"protocol %select{refined|used}0 by '@usableFromInline' protocol " | ||
"should be '@usableForInline' or public", (bool)) | ||
"should be '@usableFromInline' or public", (bool)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I wonder how long that typo was there.
// RUN: not %target-swift-frontend -typecheck %t/Utils.swift -package-name myLib -I %t 2> %t/resultUtils.output | ||
// RUN: %FileCheck %s -input-file %t/resultUtils.output -check-prefix CHECK-UTILS | ||
// CHECK-UTILS: error: class 'PackageKlass' is package and cannot be referenced from an '@inlinable' function | ||
// CHECK-UTILS: let a = PackageKlass() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the -verify
mode and \\ expected-errors
to test these? Or maybe move the CHECK
lines under the source code raising it if -verify
isn't an option? Having the error far from the code makes it hard to follow along.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense; will update the test in the next PR
Allow @usableFromInline and @inlinable to package decls
Add tests
Resolves rdar://104617133
This PR allows the following (similar to how the attributes works with internal/public decls):