• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 go.dev/issue/23434: Better synchronization of
6// parser after missing type. There should be exactly
7// one error each time, with now follow errors.
8
9package p
10
11type T /* ERROR unexpected newline */
12
13type Map map[int] /* ERROR unexpected newline */
14
15// Examples from go.dev/issue/23434:
16
17func g() {
18	m := make(map[string] /* ERROR unexpected ! */ !)
19	for {
20		x := 1
21		print(x)
22	}
23}
24
25func f() {
26	m := make(map[string] /* ERROR unexpected \) */ )
27	for {
28		x := 1
29		print(x)
30	}
31}
32