1 // Operator precedence of type ascription
2 // Type ascription has very high precedence, the same as operator `as`
4 #![feature(type_ascription)]
13 fn add(self, _rhs: Z) -> S { panic!() }
17 fn mul(self, _rhs: Z) -> S { panic!() }
21 fn neg(self) -> Z { panic!() }
25 fn deref(&self) -> &Z { panic!() }
31 &(S: &S); //~ ERROR mismatched types
35 *(S: Z); //~ ERROR mismatched types
36 //~^ ERROR type `Z` cannot be dereferenced
40 -(S: Z); //~ ERROR mismatched types
41 //~^ ERROR cannot apply unary operator `-` to type `Z`
45 (S + Z): Z; //~ ERROR mismatched types
49 (S * Z): Z; //~ ERROR mismatched types
53 (S .. S): S; //~ ERROR mismatched types