]> Cypherpunks.ru repositories - gostls13.git/blob - src/cmd/compile/internal/syntax/testdata/issue23434.go
5a72a7f4ed1769690e8f8d4c64bae59ed9f35d1a
[gostls13.git] / src / cmd / compile / internal / syntax / testdata / issue23434.go
1 // Copyright 2018 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // Test case for issue 23434: Better synchronization of
6 // parser after missing type. There should be exactly
7 // one error each time, with now follow errors.
8
9 package p
10
11 type T /* ERROR unexpected newline */
12
13 type Map map[int] /* ERROR unexpected newline */
14
15 // Examples from #23434:
16
17 func g() {
18         m := make(map[string] /* ERROR unexpected ! */ !)
19         for {
20                 x := 1
21                 print(x)
22         }
23 }
24
25 func f() {
26         m := make(map[string] /* ERROR unexpected \) */ )
27         for {
28                 x := 1
29                 print(x)
30         }
31 }