File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -5073,7 +5073,6 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyConformsToConstraint(
5073
5073
// func foo<T: BinaryInteger>(_: T) {}
5074
5074
// foo(Foo.bar) <- if `Foo` doesn't have `bar` there is
5075
5075
// no reason to complain about missing conformance.
5076
- increaseScore (SK_Fix);
5077
5076
return SolutionKind::Solved;
5078
5077
}
5079
5078
@@ -6466,7 +6465,6 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyMemberConstraint(
6466
6465
baseObjTy->isHole ()) {
6467
6466
// If base type is a "hole" there is no reason to record any
6468
6467
// more "member not found" fixes for chained member references.
6469
- increaseScore (SK_Fix);
6470
6468
markMemberTypeAsPotentialHole (memberTy);
6471
6469
return SolutionKind::Solved;
6472
6470
}
Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ protocol P {
4
4
associatedtype A
5
5
}
6
6
7
- func foo< T: P > ( _: ( ) throws -> T ) -> T . A ? {
7
+ func foo< T: P > ( _: ( ) throws -> T ) -> T . A ? { // expected-note {{where 'T' = 'Never'}}
8
8
fatalError ( )
9
9
}
10
10
11
- // TODO(diagnostics): This expression is truly ambiguous because there is no conformance between ` Never` and `P`
12
- // which means no associated type `A` and `nil` can't be an argument to any overload of `&` so we end
13
- // up generating at least 3 fixes per overload of `&`. But we could at least point to where the problems are.
14
- let _ = foo ( ) { fatalError ( ) } & nil // expected-error {{type of expression is ambiguous without more context }}
11
+ let _ = foo ( ) { fatalError ( ) } & nil // expected-error {{global function 'foo' requires that ' Never' conform to 'P'}}
12
+ // expected-error@-1 {{value of optional type 'Never.A?' must be unwrapped to a value of type 'Never.A'}}
13
+ // expected-note@-2 {{force-unwrap}}
14
+ // expected-note@-3 {{coalesce using '??' }}
Original file line number Diff line number Diff line change @@ -36,8 +36,7 @@ func test1a() -> unionSearchFlags {
36
36
37
37
func test1b( _ b : Bool ) {
38
38
_ = 123
39
- _ = . description == 1 // expected-error {{instance member 'description' cannot be used on type 'Int'}}
40
- // expected-error@-1 {{member 'description' in 'Int' produces result of type 'String', but context expects 'Int'}}
39
+ _ = . description == 1 // expected-error {{cannot infer contextual base in reference to member 'description'}}
41
40
}
42
41
43
42
enum MaybeInt {
You can’t perform that action at this time.
0 commit comments