File tree Expand file tree Collapse file tree 3 files changed +25
-14
lines changed Expand file tree Collapse file tree 3 files changed +25
-14
lines changed Original file line number Diff line number Diff line change @@ -3885,17 +3885,14 @@ bool MissingMemberFailure::diagnoseInLiteralCollectionContext() const {
3885
3885
if (!parentExpr)
3886
3886
return false ;
3887
3887
3888
- auto parentType = getType (parentExpr);
3888
+ // This could happen if collection is a dictionary literal i.e.
3889
+ // ["a": .test] - the element is a tuple - ("a", .test).
3890
+ if (isExpr<TupleExpr>(parentExpr))
3891
+ parentExpr = findParentExpr (parentExpr);
3889
3892
3890
- if (!parentType-> isKnownStdlibCollectionType () && !parentType-> is <TupleType>( ))
3893
+ if (!isExpr<CollectionExpr>(parentExpr ))
3891
3894
return false ;
3892
3895
3893
- if (isa<TupleExpr>(parentExpr)) {
3894
- parentExpr = findParentExpr (parentExpr);
3895
- if (!parentExpr)
3896
- return false ;
3897
- }
3898
-
3899
3896
if (auto *defaultableVar =
3900
3897
getRawType (parentExpr)->getAs <TypeVariableType>()) {
3901
3898
if (solution.DefaultedConstraints .count (
Original file line number Diff line number Diff line change @@ -515,3 +515,23 @@ func test_conflicting_pattern_vars() {
515
515
}
516
516
}
517
517
}
518
+
519
+ // rdar://91452726 - crash in MissingMemberFailure::diagnoseInLiteralCollectionContext
520
+ struct Test {
521
+ struct ID {
522
+ }
523
+
524
+ enum E : Hashable , Equatable {
525
+ case id
526
+ }
527
+
528
+ var arr : [ ( ID , E ) ]
529
+
530
+ func test( ) {
531
+ _ = arr. map { v in
532
+ switch v {
533
+ case . id: return true // expected-error {{value of tuple type '(Test.ID, Test.E)' has no member 'id'}}
534
+ }
535
+ }
536
+ }
537
+ }
Original file line number Diff line number Diff line change @@ -539,12 +539,6 @@ lldb-use-system-debugserver
539
539
release-debuginfo
540
540
assertions
541
541
542
- # We need to build an unoptimized swift benchmark driver for stepper testing.
543
- # Ditto for the swift stdlib. (LLDB doesn't support stepping through optimized
544
- # swift code yet.)
545
- extra-cmake-options =-DSWIFT_BENCHMARK_UNOPTIMIZED_DRIVER:BOOL =1
546
- debug-swift-stdlib
547
-
548
542
# Disable non-x86 building/testing.
549
543
skip-build-ios
550
544
skip-test-ios
You can’t perform that action at this time.
0 commit comments