Skip to content

Commit 8a65800

Browse files
author
ematejska
authored
Merge pull request #13873 from slavapestov/type-reconstruction-inout-4.1
TypeReconstruction: Fix reconstruction of InOutType [4.1]
2 parents edecd95 + 39d2a0a commit 8a65800

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/IDE/TypeReconstruction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1673,7 +1673,7 @@ static void VisitNodeInOut(
16731673
VisitNodeResult type_result;
16741674
VisitNode(ast, cur_node->getFirstChild(), type_result);
16751675
if (type_result._types.size() == 1 && type_result._types[0]) {
1676-
result._types.push_back(Type(LValueType::get(type_result._types[0])));
1676+
result._types.push_back(Type(InOutType::get(type_result._types[0])));
16771677
} else {
16781678
result._error = "couldn't resolve referent type";
16791679
}

test/IDE/reconstruct_type_from_mangled_name.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,21 @@ class Myclass2 {
6565
arr1.append(1)
6666
// FIXME: missing append()
6767
// CHECK: dref: FAILURE for 'append' usr=s:Sa6appendyxF
68-
// CHECK: type: (@lvalue Array<Int>) -> (Int) -> ()
68+
// CHECK: type: (inout Array<Int>) -> (Int) -> ()
6969

7070
var arr2 : [Mystruct1]
7171
// CHECK: decl: var arr2: [Mystruct1]
7272
// CHECK: type: Array<Mystruct1>
7373

7474
arr2.append(Mystruct1())
75-
// CHECK: type: (@lvalue Array<Mystruct1>) -> (Mystruct1) -> ()
75+
// CHECK: type: (inout Array<Mystruct1>) -> (Mystruct1) -> ()
7676

7777
var arr3 : [Myclass1]
7878
// CHECK: decl: var arr3: [Myclass1]
7979
// CHECK: type: Array<Myclass1>
8080

8181
arr3.append(Myclass1())
82-
// CHECK: type: (@lvalue Array<Myclass1>) -> (Myclass1) -> ()
82+
// CHECK: type: (inout Array<Myclass1>) -> (Myclass1) -> ()
8383

8484
_ = Myclass2.init()
8585
// CHECK: dref: init()
@@ -116,7 +116,7 @@ func f2() {
116116
e.method()
117117
// CHECK: (MyEnum) -> (MyEnum) -> Int
118118
e.compare(e)
119-
// CHECK: (@lvalue MyEnum) -> () -> ()
119+
// CHECK: (inout MyEnum) -> () -> ()
120120
e.mutatingMethod()
121121
}
122122

0 commit comments

Comments
 (0)