|
|
@@ -22,14 +22,9 @@ const TEST_PRELUDE: &str = "
|
|
|
struct SomeStruct { a: A, b: B }
|
|
|
|
|
|
let callable = takes_a_returns_b
|
|
|
- ";
|
|
|
|
|
|
-fn base_type(name: &str) -> BaseRepresentation {
|
|
|
- BaseRepresentation::from_factor(BaseRepresentationFactor(
|
|
|
- name.into(),
|
|
|
- Rational::from_integer(1),
|
|
|
- ))
|
|
|
-}
|
|
|
+ fn atan2<T>(x: T, y: T) -> Scalar
|
|
|
+ ";
|
|
|
|
|
|
fn type_a() -> DType {
|
|
|
DType::base_dimension("A")
|
|
|
@@ -254,6 +249,11 @@ fn generics_basic() {
|
|
|
f(2 a, 2 b)
|
|
|
",
|
|
|
);
|
|
|
+ assert_successful_typecheck(
|
|
|
+ "
|
|
|
+ fn f3<T>(y: T, x: T) = atan2(y, x)
|
|
|
+ ",
|
|
|
+ );
|
|
|
|
|
|
// assert!(matches!(
|
|
|
// get_typecheck_error("fn f<T1, T2>(x: T1, y: T2) -> T2/T1 = x/y"),
|