reject_concat_non_text.mx raw

   1  // expected: cannot concatenate value of type
   2  //
   3  // '|' concatenates when EITHER side is text and is the bitwise OR otherwise, so
   4  // a text/other MIX is a type error. stage4 emitted the concatenation anyway and
   5  // clang rejected the module with
   6  //
   7  //     '%t7' defined with type 'i64' but expected '{ ptr, i64, i64 }'
   8  //       %cc4 = extractvalue {ptr, i64, i64} %t7, 0
   9  //
  10  // which names no source line, no type and no operator. The fix reports the mix
  11  // where it is written, and points at .String(), which is the idiom this tree
  12  // uses for every builtin (string and []byte are one type in Moxie, so TextType
  13  // covers both spellings and `"a" | []byte("b")` stays legal).
  14  package main
  15  
  16  func main() {
  17  	var a int64 = 5
  18  	println("x=" | a)
  19  }
  20