Source file src/cmd/compile/internal/types2/testdata/local/issue68183.go

     1  // Copyright 2024 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 that invalid identifiers reported by the parser
     6  // don't lead to additional errors during typechecking.
     7  
     8  package p
     9  
    10  import "fmt"
    11  
    12  var (
    13  	☹x /* ERROR "invalid character" */ int
    14  	_ = ☹x // ERROR "invalid character"
    15  	_ = fmt.☹x // ERROR "invalid character"
    16  	_ = ☹fmt /* ERROR "invalid character" */ .Println
    17  	_ = _世界 // ERROR "undefined: _世界"
    18  	_ = ☹_世界 // ERROR "invalid character"
    19  )
    20  
    21  func ☹m /* ERROR "invalid character" */ () {}
    22  
    23  type T struct{}
    24  func (T) ☹m /* ERROR "invalid character" */ () {}
    25  
    26  func _() {
    27  	var x T
    28  	x.☹m /* ERROR "invalid character" */ ()
    29  }
    30  

View as plain text