Files
swift-mirror/validation-test/Sema/SwiftUI/rdar139237781.swift
Slava Pestov d67e89d89c Sema: Fix handling of appliedPropertyWrappers in ConstraintSystem::replaySolution()
When we replay a solution, we must record changes in the trail, so fix the
logic to do that. This fixes the first assertion failure with this test case.

The test case also exposed a second issue. We synthesize a CustomAttr in
applySolutionToClosurePropertyWrappers() with a type returned by simplifyType().
Eventually, CustomAttrNominalRequest::evaluate() looks at this type, and passes
it to directReferencesForType(). Unfortunately, this entry point does not
understand type aliases whose underlying type is a type parameter.
However, directReferencesForType() is the wrong thing to use here, and we
can just call getAnyNominal() instead.

Fixes rdar://139237781.
2024-11-08 10:46:07 -05:00

31 lines
515 B
Swift

// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx12
// REQUIRES: objc_interop
// REQUIRES: OS=macosx
import SwiftUI
struct V: View {
struct M: Identifiable {
let id: String
}
class C: ObservableObject {
@Published var m: [M]
init() {
self.m = []
}
}
@ObservedObject var c: C
var body: some View {
Table($c.m) {
TableColumn("") { $entry in
Text("hi")
}
}
}
}