reject_type_as_value.mx raw

   1  // expected: cannot use a slice type as a value
   2  package main
   3  
   4  func main() {
   5  	// A type is not a value. Both of these used to be ACCEPTED: buildExpr
   6  	// returned nil for the type node, the short-var path printed a diagnostic
   7  	// to stderr and carried on with an Int32 placeholder, and the build exited
   8  	// 0 - so `x` became an int32 and the trailing `+ 1` vanished.
   9  	x := []int32
  10  	y := []chan int32 + 1
  11  	println(len(x), len(y))
  12  }
  13