reject_unknown_method.mx raw

   1  // expected: type int32 has no field or method Nope
   2  //
   3  // A method call on a non-struct value must fail loud. stage4 only checked
   4  // selectors that produce a value (struct fields); the call path returned nil
   5  // on a failed method lookup, so `n.Nope()` fell through to the emitter and
   6  // built a call through garbage. Legacy reports it through go/types:
   7  // "n.Nope undefined (type int32 has no field or method Nope)".
   8  package main
   9  
  10  func main() {
  11  	n := int32(5)
  12  	n.Nope()
  13  }
  14