Hacker News new | past | comments | ask | show | jobs | submit login

In addition to what the others said about this not working you can get this to work by providing a conversion to either of the calls, so this works:

  fn foo32(x: f32) { println!("{}", x); }
  fn foo64(x: f64) { println!("{}", x); }

  fn bar64() {
      let x = 5.0; // f64
      foo64(x);
      foo32(x as f32);
  }

  fn bar32() {
      let x = 5.0; // f32, not f64
      foo32(x);
      foo64(x as f64);
  }



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: