github.com/activestate/go@v0.0.0-20170614201249-0b81c023a722/test/typecheck.go (about)

     1  // errorcheck
     2  
     3  // Verify that the Go compiler will not
     4  // die after running into an undefined
     5  // type in the argument list for a
     6  // function.
     7  // Does not compile.
     8  
     9  package main
    10  
    11  func mine(int b) int {	// ERROR "undefined.*b"
    12  	return b + 2	// ERROR "undefined.*b"
    13  }
    14  
    15  func main() {
    16  	mine()		// GCCGO_ERROR "not enough arguments"
    17  	c = mine()	// ERROR "undefined.*c|not enough arguments"
    18  }