File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -11024,9 +11024,6 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyMemberConstraint(
1102411024 impact += 10;
1102511025 }
1102611026
11027- if (instanceTy->isAny() || instanceTy->isAnyObject())
11028- impact += 5;
11029-
1103011027 auto *anchorExpr = getAsExpr(locator->getAnchor());
1103111028 if (anchorExpr) {
1103211029 if (auto *UDE = dyn_cast<UnresolvedDotExpr>(anchorExpr)) {
Original file line number Diff line number Diff line change @@ -826,3 +826,14 @@ do {
826826 // expected-error@-1 {{value of type 'any BinaryInteger' has no member 'op'}}
827827 }
828828}
829+
830+ do {
831+ func test< T> ( _: T ) -> T ? { nil }
832+ func test< U> ( _: U ) -> Int { 0 }
833+
834+ func compute( x: Any ) {
835+ test ( x) !. unknown ( )
836+ // expected-error@-1 {{value of type 'Any' has no member 'unknown'}}
837+ // expected-note@-2 {{cast 'Any' to 'AnyObject' or use 'as!' to force downcast to a more specific type to access members}}
838+ }
839+ }
You can’t perform that action at this time.
0 commit comments