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(
3829
3829
// If this is an implicit 'something-to-pointer' conversion
3830
3830
// it's going to be diagnosed by specialized fix which deals
3831
3831
// 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
+ }
3834
3837
3835
3838
// If this is a ~= operator implicitly generated by pattern matching
3836
3839
// 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>??) {}
41
41
var i = 0
42
42
SR12382 ( & i) // expected-error {{cannot convert value of type 'UnsafeMutablePointer<Int>' to expected argument type 'UnsafeMutablePointer<Double>'}}
43
43
// 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