Commit aa20633
authored
[AutoDiff] [Sema] Fix missing access-level mismatch diagnostic in
When a derivative function is internal and its original function is
public, there should be an error when the derivative is not `@usableFromInline`.
This patch fixes a bug where the error does not appear in SwiftPM debug
build configurations (or any configurations with `-enable-testing`).
`ValueDecl::getEffectiveAccess()` should not be used when we perform
formal access checking for AutoDiff-related declaration attributes because
it will treat all internal declarations as public when `-enable-testing` is
enabled. Instea we should use a combination of `ValueDecl::getFormalAccess()`
and `ValueDecl::isUsableFromInline()`.
Also, add a `RUN` line with `-enable-testing` to all AutoDiff declaration
attribute test files.
Resolves SR-13500 (rdar://68336300).-enable-testing builds. (swiftlang#33800)1 parent 9d908ec commit aa20633
File tree
4 files changed
+5
-1
lines changed- lib/Sema
- test/AutoDiff/Sema
4 files changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4645 | 4645 | | |
4646 | 4646 | | |
4647 | 4647 | | |
4648 | | - | |
| 4648 | + | |
| 4649 | + | |
4649 | 4650 | | |
4650 | 4651 | | |
4651 | 4652 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
0 commit comments