Main.hx 477 B

123456789101112131415161718
  1. typedef A = { var pos: Int; var len: Int; };
  2. typedef NOT_A = { var pos: Array<String>; var len: Array<Float>; };
  3. typedef X = { var ?x:Int; var ?y:Int; };
  4. typedef Y = { var x:Int; var y:Int; };
  5. typedef Z = { var ?pos:Array<String>; var ?len:Array<Float>; };
  6. class Main {
  7. static var a:A = { pos : 1, len : 2 };
  8. static function main(){
  9. var not_a:NOT_A = (((a:X):Y):Z); // !!! should obviously not compile
  10. not_a.pos.push("");
  11. }
  12. }