diff --git a/compiler/noirc_frontend/src/hir_def/types.rs b/compiler/noirc_frontend/src/hir_def/types.rs index 77030b0e048..3d4f3e77792 100644 --- a/compiler/noirc_frontend/src/hir_def/types.rs +++ b/compiler/noirc_frontend/src/hir_def/types.rs @@ -241,11 +241,9 @@ impl Kind { /// during monomorphization. pub(crate) fn default_type(&self) -> Option { match self { - Kind::Any => None, Kind::IntegerOrField => Some(Type::default_int_or_field_type()), Kind::Integer => Some(Type::default_int_type()), - Kind::Normal => None, - Kind::Numeric(typ) => Some(*typ.clone()), + Kind::Any | Kind::Normal | Kind::Numeric(..) => None, } } diff --git a/test_programs/compile_failure/cannot_deduce_numeric_generic/Nargo.toml b/test_programs/compile_failure/cannot_deduce_numeric_generic/Nargo.toml new file mode 100644 index 00000000000..e87c464f6c7 --- /dev/null +++ b/test_programs/compile_failure/cannot_deduce_numeric_generic/Nargo.toml @@ -0,0 +1,7 @@ +[package] +name = "cannot_deduce_numeric_generic" +type = "bin" +authors = [""] +compiler_version = ">=0.33.0" + +[dependencies] diff --git a/test_programs/compile_failure/cannot_deduce_numeric_generic/src/main.nr b/test_programs/compile_failure/cannot_deduce_numeric_generic/src/main.nr new file mode 100644 index 00000000000..ee889e805f7 --- /dev/null +++ b/test_programs/compile_failure/cannot_deduce_numeric_generic/src/main.nr @@ -0,0 +1,8 @@ +fn foo() -> u32 { + N +} + +fn main() { + let _ = foo(); +} +