Skip to content

Commit 6c9bd8d

Browse files
authored
Merge pull request #65071 from xedin/rdar-107835060-followup
[CSSyntaticElement] Canonicalize type before collecting "in scope" va…
2 parents 6e2c222 + 976c0b1 commit 6c9bd8d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/Sema/CSSyntacticElement.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class TypeVariableRefFinder : public ASTWalker {
217217
// For example `Typealias<$T, $U>.Context` which desugars into
218218
// `_Context<$U>` would bring in `$T` that could be inferrable
219219
// only after the body of the closure is solved.
220-
type = type->getDesugaredType();
220+
type = type->getCanonicalType();
221221

222222
// Don't walk into the opaque archetypes because they are not
223223
// transparent in this context - `some P` could reference a

validation-test/Sema/SwiftUI/rdar107835060.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct TestView<Data, Content: View> : View {
3232
typealias Context = Content._Context where Content: ContentProtocol
3333

3434
init<R, C>(_ data: Data,
35-
@ViewBuilder shelfContent: @escaping (Context) -> C)
35+
@ViewBuilder shelfContent: @escaping ([Context]) -> C)
3636
where Data.Element == any Model<R>,
3737
Content == ContinuousContent<LazyMapCollection<Data, AnyModel<R>>, C> {
3838
}
@@ -44,7 +44,7 @@ struct TestView<Data, Content: View> : View {
4444
func test(values: [any Model<[Int]>]) -> some View {
4545
TestView(values) { context in
4646
VStack {
47-
if context.offset == 0 {
47+
if context.first?.offset == 0 {
4848
}
4949
}
5050
}

0 commit comments

Comments
 (0)