Skip to content

Type system examples

  • let x = 1; -> i64
  • let y = 1.0; -> f64
  • let x: i64 = 1; (implicit i32 -> i64 allowed)
  • let y: f64 = 1.0f32; (implicit f32 -> f64 allowed)
  • let x: i32 = 1; -> error without cast(i32, 1)
  • let y: f64 = 1; -> error without cast(f64, 1)
  • 1 + 2.0 -> error unless one side casted.