Skip to content

Commit 7c25c18

Browse files
authored
Merge pull request #67056 from DougGregor/rename-observation-module-5.9
[5.9] [SE-0395] Rename _Observation module to Observation
2 parents 1b1022f + bc1ef24 commit 7c25c18

File tree

9 files changed

+9
-13
lines changed

9 files changed

+9
-13
lines changed

include/swift/AST/KnownIdentifiers.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ IDENTIFIER(objectForKeyedSubscript)
126126
IDENTIFIER(ObjectiveC)
127127
IDENTIFIER_(ObjectiveCType)
128128
IDENTIFIER(Observation)
129-
IDENTIFIER_WITH_NAME(Observation_, "_Observation")
130129
IDENTIFIER(oldValue)
131130
IDENTIFIER(Optional)
132131
IDENTIFIER_(OptionalNilComparisonType)

lib/AST/NameLookup.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -680,11 +680,8 @@ static void recordShadowedDeclsAfterTypeMatch(
680680
}
681681
}
682682

683-
// Next, prefer any other module over the (_)Observation module.
684-
auto obsModule = ctx.getLoadedModule(ctx.Id_Observation);
685-
if (!obsModule)
686-
obsModule = ctx.getLoadedModule(ctx.Id_Observation_);
687-
if (obsModule) {
683+
// Next, prefer any other module over the Observation module.
684+
if (auto obsModule = ctx.getLoadedModule(ctx.Id_Observation)) {
688685
if ((firstModule == obsModule) != (secondModule == obsModule)) {
689686
// If second module is (_)Observation, then it is shadowed by
690687
// first.

lib/Macros/Sources/ObservationMacros/ObservableMacro.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import SwiftSyntaxMacros
1717
@_implementationOnly import SwiftSyntaxBuilder
1818

1919
public struct ObservableMacro {
20-
static let moduleName = "_Observation"
20+
static let moduleName = "Observation"
2121

2222
static let conformanceName = "Observable"
2323
static var qualifiedConformanceName: String {

stdlib/public/Observation/Sources/Observation/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
list(APPEND swift_runtime_library_compile_flags -I${SWIFT_SOURCE_DIR}/stdlib/include -I${SWIFT_SOURCE_DIR}/include)
1414

15-
add_swift_target_library(swift_Observation ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
15+
add_swift_target_library(swiftObservation ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
1616
Locking.cpp
1717
Locking.swift
1818
Observable.swift

test/ModuleInterface/Observable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// REQUIRES: swift_swift_parser
1010
// REQUIRES: observation
1111

12-
import _Observation
12+
import Observation
1313

1414
// CHECK-NOT: @Observable
1515
// CHECK-NOT: @ObservationIgnored
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
@_exported import _Observation
1+
@_exported import Observation
22

test/NameLookup/observable_shadowing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import HasObservable
1111
#if VIA_REEXPORT
1212
import ReexportsObservation
1313
#else
14-
import _Observation
14+
import Observation
1515
#endif
1616

1717
func foo() -> Observable<Int> {

test/stdlib/Observation/Observable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// REQUIRES: objc_interop
1111

1212
import StdlibUnittest
13-
import _Observation
13+
import Observation
1414

1515
@usableFromInline
1616
@inline(never)

test/stdlib/Observation/ObservableDidSetWillSet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// UNSUPPORTED: use_os_stdlib
1212
// UNSUPPORTED: back_deployment_runtime
1313

14-
import _Observation
14+
import Observation
1515

1616
@Observable
1717
public class Model {

0 commit comments

Comments
 (0)