mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Re-implement operator and precedencegroup decl lookup to use `namelookup::getAllImports` and existing decl shadowing logic. This allows us to find operator decls through `@_exported` imports, prefer operator decls defined in the same module over imported decls, and fixes a couple of other subtle issues. Because this new implementation is technically source breaking, as we can find multiple results where we used to only find one result, it's placed behind the new Frontend flag `-enable-new-operator-lookup` (with the aim of enabling it by default when we get a new language mode). However the new logic will always be used if the result is unambiguous. This means that e.g `@_exported` operators will be instantly available as long as there's only one candidate. If multiple candidates are found, we fall back to the old logic. Resolves SR-12132. Resolves rdar://59198796.
11 lines
458 B
Swift
11 lines
458 B
Swift
precedencegroup RedeclaredAcrossFiles {} // expected-note {{previous precedence group declaration here}}
|
|
|
|
infix operator ^^^ // expected-note {{previous operator declaration here}}
|
|
prefix operator >>> // expected-note {{previous operator declaration here}}
|
|
postfix operator <<< // expected-note {{previous operator declaration here}}
|
|
|
|
precedencegroup P1 {}
|
|
infix operator ^^^^ : P1 // expected-note {{previous operator declaration here}}
|
|
|
|
infix operator &&&
|