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(
11024
11024
impact += 10;
11025
11025
}
11026
11026
11027
- if (instanceTy->isAny() || instanceTy->isAnyObject())
11028
- impact += 5;
11029
-
11030
11027
auto *anchorExpr = getAsExpr(locator->getAnchor());
11031
11028
if (anchorExpr) {
11032
11029
if (auto *UDE = dyn_cast<UnresolvedDotExpr>(anchorExpr)) {
Original file line number Diff line number Diff line change @@ -826,3 +826,14 @@ do {
826
826
// expected-error@-1 {{value of type 'any BinaryInteger' has no member 'op'}}
827
827
}
828
828
}
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