diff --git a/compiler/noirc_frontend/src/hir_def/types.rs b/compiler/noirc_frontend/src/hir_def/types.rs index 8f20fe1c685..b8c98428bb0 100644 --- a/compiler/noirc_frontend/src/hir_def/types.rs +++ b/compiler/noirc_frontend/src/hir_def/types.rs @@ -881,7 +881,7 @@ impl Type { } pub fn type_variable(id: TypeVariableId) -> Type { - let var = TypeVariable::unbound(id, Kind::Normal); + let var = TypeVariable::unbound(id, Kind::Any); Type::TypeVariable(var) } diff --git a/compiler/noirc_frontend/src/tests/turbofish.rs b/compiler/noirc_frontend/src/tests/turbofish.rs index 43d536fd196..b1156b20eb0 100644 --- a/compiler/noirc_frontend/src/tests/turbofish.rs +++ b/compiler/noirc_frontend/src/tests/turbofish.rs @@ -196,3 +196,21 @@ fn turbofish_in_struct_pattern_generic_count_mismatch() { assert_eq!(*expected, 1); assert_eq!(*found, 2); } + +#[test] +fn numeric_turbofish() { + let src = r#" + struct Reader { + } + + impl Reader { + fn read(_self: Self) {} + } + + fn main() { + let reader: Reader<1234> = Reader {}; + let _ = reader.read::<1234>(); + } + "#; + assert_no_errors(src); +}