Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/swift/AST/KnownIdentifiers.def
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ IDENTIFIER(objectForKeyedSubscript)
IDENTIFIER(ObjectiveC)
IDENTIFIER_(ObjectiveCType)
IDENTIFIER(Observation)
IDENTIFIER_WITH_NAME(Observation_, "_Observation")
IDENTIFIER(oldValue)
IDENTIFIER(Optional)
IDENTIFIER_(OptionalNilComparisonType)
Expand Down
7 changes: 2 additions & 5 deletions lib/AST/NameLookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,11 +680,8 @@ static void recordShadowedDeclsAfterTypeMatch(
}
}

// Next, prefer any other module over the (_)Observation module.
auto obsModule = ctx.getLoadedModule(ctx.Id_Observation);
if (!obsModule)
obsModule = ctx.getLoadedModule(ctx.Id_Observation_);
if (obsModule) {
// Next, prefer any other module over the Observation module.
if (auto obsModule = ctx.getLoadedModule(ctx.Id_Observation)) {
if ((firstModule == obsModule) != (secondModule == obsModule)) {
// If second module is (_)Observation, then it is shadowed by
// first.
Expand Down
2 changes: 1 addition & 1 deletion lib/Macros/Sources/ObservationMacros/ObservableMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import SwiftSyntaxMacros
@_implementationOnly import SwiftSyntaxBuilder

public struct ObservableMacro {
static let moduleName = "_Observation"
static let moduleName = "Observation"

static let conformanceName = "Observable"
static var qualifiedConformanceName: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

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

add_swift_target_library(swift_Observation ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
add_swift_target_library(swiftObservation ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
Locking.cpp
Locking.swift
Observable.swift
Expand Down
2 changes: 1 addition & 1 deletion test/ModuleInterface/Observable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// REQUIRES: swift_swift_parser
// REQUIRES: observation

import _Observation
import Observation

// CHECK-NOT: @Observable
// CHECK-NOT: @ObservationIgnored
Expand Down
2 changes: 1 addition & 1 deletion test/NameLookup/Inputs/ReexportsObservation.swift
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@_exported import _Observation
@_exported import Observation

2 changes: 1 addition & 1 deletion test/NameLookup/observable_shadowing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import HasObservable
#if VIA_REEXPORT
import ReexportsObservation
#else
import _Observation
import Observation
#endif

func foo() -> Observable<Int> {
Expand Down
2 changes: 1 addition & 1 deletion test/stdlib/Observation/Observable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// REQUIRES: objc_interop

import StdlibUnittest
import _Observation
import Observation

@usableFromInline
@inline(never)
Expand Down
2 changes: 1 addition & 1 deletion test/stdlib/Observation/ObservableDidSetWillSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime

import _Observation
import Observation

@Observable
public class Model {
Expand Down