File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -2651,11 +2651,10 @@ namespace {
2651
2651
// case (when we turn the inout into an UnsafePointer) than to try to
2652
2652
// discover that we're in that case right now.
2653
2653
expr->getSubExpr ()->propagateLValueAccessKind (AccessKind::ReadWrite);
2654
- auto lvTy = expr->getSubExpr ()->getType ()->castTo <LValueType> ();
2654
+ auto objectTy = expr->getSubExpr ()->getType ()->getRValueType ();
2655
2655
2656
- // The type is simply inout.
2657
- // Compute the type of the inout expression.
2658
- expr->setType (InOutType::get (lvTy->getObjectType ()));
2656
+ // The type is simply inout of whatever the lvalue's object type was.
2657
+ expr->setType (InOutType::get (objectTy));
2659
2658
return expr;
2660
2659
}
2661
2660
Original file line number Diff line number Diff line change @@ -699,3 +699,10 @@ func test23086402(a: A23086402) {
699
699
print ( a. b. c + " " ) // expected-error {{cannot convert value of type '[String]' to expected argument type 'String'}}
700
700
}
701
701
702
+ // <rdar://problem/23719432> [practicalswift] Compiler crashes on &(Int:_)
703
+ func test23719432( ) {
704
+ var x = 42
705
+ & ( Int: x) // expected-error {{'&' can only appear immediately in a call argument list}}
706
+ }
707
+
708
+
You can’t perform that action at this time.
0 commit comments