Text file src/go/parser/testdata/issue23434.src

     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  func g() {
    12  	m := make(map[string]! /* ERROR "expected type, found '!'" */ )
    13  	for {
    14  		x := 1
    15  		print(x)
    16  	}
    17  }
    18  
    19  func f() {
    20  	m := make(map[string]) /* ERROR "expected type, found '\)'" */
    21  	for {
    22  		x := 1
    23  		print(x)
    24  	}
    25  }
    26  

View as plain text