@@ -49,6 +49,7 @@ var testfile = []testline{
49
49
{line : "func f4(x int) { }" },
50
50
{line : "func f5(x int) { }" },
51
51
{line : "func f6(x int) { }" },
52
+ {line : "func fi(x interface{}) { if a, ok := x.(error); ok { a.Error() } }" },
52
53
{line : "func gret1() int { return 2 }" },
53
54
{line : "func gretbool() bool { return true }" },
54
55
{line : "func gret3() (int, int, int) { return 0, 1, 2 }" },
@@ -163,6 +164,15 @@ var testfile = []testline{
163
164
{line : " }" },
164
165
{line : " f(3); f1(b)" },
165
166
{line : "}" },
167
+ {line : "func TestEscape() {" },
168
+ {line : " a := 1" , vars : []string {"var a int" }},
169
+ {line : " {" },
170
+ {line : " b := 2" , scopes : []int {1 }, vars : []string {"var &b *int" , "var p *int" }},
171
+ {line : " p := &b" , scopes : []int {1 }},
172
+ {line : " f1(a)" , scopes : []int {1 }},
173
+ {line : " fi(p)" , scopes : []int {1 }},
174
+ {line : " }" },
175
+ {line : "}" },
166
176
{line : "func main() {" },
167
177
{line : " TestNestedFor()" },
168
178
{line : " TestOas2()" },
@@ -173,6 +183,7 @@ var testfile = []testline{
173
183
{line : " TestBlock()" },
174
184
{line : " TestDiscontiguousRanges()" },
175
185
{line : " TestClosureScope()" },
186
+ {line : " TestEscape()" },
176
187
{line : "}" },
177
188
}
178
189
0 commit comments