File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -3829,8 +3829,11 @@ bool ConstraintSystem::repairFailures(
38293829 // If this is an implicit 'something-to-pointer' conversion
38303830 // it's going to be diagnosed by specialized fix which deals
38313831 // with generic argument mismatches.
3832- if (matchKind == ConstraintKind::BindToPointerType)
3833- break ;
3832+ if (matchKind == ConstraintKind::BindToPointerType) {
3833+ auto *member = rhs->getAs <DependentMemberType>();
3834+ if (!(member && member->getBase ()->hasHole ()))
3835+ break ;
3836+ }
38343837
38353838 // If this is a ~= operator implicitly generated by pattern matching
38363839 // let's not try to fix right-hand side of the operator because it's
Original file line number Diff line number Diff line change @@ -41,3 +41,9 @@ func SR12382(_ x: UnsafeMutablePointer<Double>??) {}
4141var i = 0
4242SR12382 ( & i) // expected-error {{cannot convert value of type 'UnsafeMutablePointer<Int>' to expected argument type 'UnsafeMutablePointer<Double>'}}
4343// expected-note@-1 {{arguments to generic parameter 'Pointee' ('Int' and 'Double') are expected to be equal}}
44+
45+ //problem/68254165 - Bad diagnostic when using String init(decodingCString:) with an incorrect pointer type
46+ func rdar68254165( ptr: UnsafeMutablePointer < Int8 > ) {
47+ _ = String ( decodingCString: ptr, as: . utf8) // expected-error {{generic parameter 'Encoding' could not be inferred}}
48+ // expected-error@-1 {{type '_.Type' has no member 'utf8'}}
49+ }
You can’t perform that action at this time.
0 commit comments