-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Diagnostics] Port name shadowing diagnostics #29024
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
@swift-ci please smoke test compiler performance |
I think this should be okay to use performance wise until we figure out a better solution by refactoring |
@swift-ci please smoke test compiler performance |
@swift-ci please test source compatibility |
@swift-ci please build toolchain macOS platform |
@swift-ci please build toolchain macOS platform |
macOS Toolchain Install command |
0acc5e9
to
5f394a5
Compare
@swift-ci please smoke test compiler performance |
Summary for master smoketestNo regressions above thresholds Debugdebug briefRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
debug detailedRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (18)
Releaserelease briefRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
release detailedRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (18)
|
@swift-ci please test |
@swift-ci please test source compatibility |
@swift-ci please test Linux platform |
Build failed |
There are a couple of LLDB failures:
which have to do with unknown symbol for |
@swift-ci please test |
Build failed |
@swift-ci please smoke test macOS platform |
Build failed |
@swift-ci please smoke test macOS platform |
Diagnose an attempt to reference a top-level name shadowed by a local member e.g. ```swift extension Sequence { func test() -> Int { return max(1, 2) } } ``` Here `min` refers to a global function `min<T>(_: T, _: T)` in `Swift` module and can only be accessed by adding `Swift.` to it, because `Sequence` has a member named `min` which accepts a single argument.
Stop filtering outer overload choices while trying to pre-check expression, instead have it always fetch those and use new fix to only attempt them in diagnostic mode (unless it's min/max situation with conditional conformances).
Although such functionality is not yet supported we have to mirror AST lookup and add such members into results, otherwise there is a risk of inner/outer results mismatch.
e75de93
to
93c2321
Compare
The current way that VarDecl::isLazilyInitializedGlobal() is implemented does not work in the debugger, since the DeclContext of all VarDecls are deserialized Swift modules. By adding a bit to the VarDecl we can recover the fact that a VarDecl was in fact a global even in the debugger. <rdar://problem/58939370>
This is in preparation to a change in serialization of global variables where this detail will matter.
test with swiftlang/llvm-project#674 |
test with swiftlang/llvm-project#674 |
Summary for master smoketestNo regressions above thresholds Debugdebug briefRegressed (0)
Improved (2)
Unchanged (delta < 1.0% or delta < 100.0ms) (1)
debug detailedRegressed (0)
Improved (6)
Unchanged (delta < 1.0% or delta < 100.0ms) (12)
Releaserelease briefRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
release detailedRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (18)
|
@swift-ci please test source compatibility |
@swift-ci please test compiler performance |
Summary for master fullUnexpected test results, excluded stats for RxCocoa, SwifterSwift, Base64CoderSwiftUI Regressions found (see below) Debug-batchdebug-batch briefRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
debug-batch detailedRegressed (8)
Improved (3)
Unchanged (delta < 1.0% or delta < 100.0ms) (199)
Releaserelease briefRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
release detailedRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (18)
|
Looks like the only counters regressed are associated with debug configuration and expected as they are all about global requests which with |
Ok, |
@swift-ci please test |
Build failed |
Build failed |
test with swiftlang/llvm-project#674 |
1 similar comment
test with swiftlang/llvm-project#674 |
Build failed |
Build failed |
0899a9e
to
15c1b4e
Compare
test with swiftlang/llvm-project#674 |
Build failed |
Build failed |
The change to introduce a "top-level" bit for VarDecls requires a module format version bump, per swiftlang#29024. Fixes rdar://problem/59078925
Diagnose an attempt to reference a top-level name shadowed by
a local member e.g.
Here
max
refers to a global functionmax<T>(_: T, _: T)
inSwift
module and can only be accessed by adding
Swift.
to it, becauseSequence
has a member named
max
which accepts a single argument.Resolves: rdar://problem/25197358
Resolves: rdar://problem/30528057
Resolves: rdar://problem/32854314
Resolves: rdar://problem/58939370