diff --git a/crates/ty_python_semantic/resources/mdtest/generics/legacy/paramspec.md b/crates/ty_python_semantic/resources/mdtest/generics/legacy/paramspec.md index 8f6088594d..efa9a37d0f 100644 --- a/crates/ty_python_semantic/resources/mdtest/generics/legacy/paramspec.md +++ b/crates/ty_python_semantic/resources/mdtest/generics/legacy/paramspec.md @@ -251,7 +251,7 @@ reveal_type(OnlyParamSpec[...]().attr) # revealed: (...) -> None def func(c: Callable[P2, None]): reveal_type(OnlyParamSpec[P2]().attr) # revealed: (**P2@func) -> None -# error: [invalid-type-form] "ParamSpec `P2` is unbound" +# error: [invalid-type-arguments] "ParamSpec `P2` is unbound" reveal_type(OnlyParamSpec[P2]().attr) # revealed: (...) -> None # error: [invalid-type-arguments] "No type argument provided for required type variable `P1` of class `OnlyParamSpec`" @@ -295,7 +295,7 @@ reveal_type(TypeVarAndParamSpec[int, [int, str]]().attr) # revealed: (int, str, reveal_type(TypeVarAndParamSpec[int, [str]]().attr) # revealed: (str, /) -> int reveal_type(TypeVarAndParamSpec[int, ...]().attr) # revealed: (...) -> int -# error: [invalid-type-form] "ParamSpec `P2` is unbound" +# error: [invalid-type-arguments] "ParamSpec `P2` is unbound" reveal_type(TypeVarAndParamSpec[int, P2]().attr) # revealed: (...) -> int # error: [invalid-type-arguments] "Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...`" reveal_type(TypeVarAndParamSpec[int, int]().attr) # revealed: (...) -> int diff --git a/crates/ty_python_semantic/resources/mdtest/generics/pep695/paramspec.md b/crates/ty_python_semantic/resources/mdtest/generics/pep695/paramspec.md index f6998881d1..2d0a4c287d 100644 --- a/crates/ty_python_semantic/resources/mdtest/generics/pep695/paramspec.md +++ b/crates/ty_python_semantic/resources/mdtest/generics/pep695/paramspec.md @@ -237,7 +237,7 @@ def func[**P2](c: Callable[P2, None]): P2 = ParamSpec("P2") -# error: [invalid-type-form] "ParamSpec `P2` is unbound" +# error: [invalid-type-arguments] "ParamSpec `P2` is unbound" reveal_type(OnlyParamSpec[P2]().attr) # revealed: (...) -> None # error: [invalid-type-arguments] "No type argument provided for required type variable `P1` of class `OnlyParamSpec`" @@ -281,7 +281,7 @@ reveal_type(TypeVarAndParamSpec[int, [int, str]]().attr) # revealed: (int, str, reveal_type(TypeVarAndParamSpec[int, [str]]().attr) # revealed: (str, /) -> int reveal_type(TypeVarAndParamSpec[int, ...]().attr) # revealed: (...) -> int -# error: [invalid-type-form] "ParamSpec `P2` is unbound" +# error: [invalid-type-arguments] "ParamSpec `P2` is unbound" reveal_type(TypeVarAndParamSpec[int, P2]().attr) # revealed: (...) -> int # error: [invalid-type-arguments] "Type argument for `ParamSpec` must be" reveal_type(TypeVarAndParamSpec[int, int]().attr) # revealed: (...) -> int diff --git a/crates/ty_python_semantic/src/types/infer/builder.rs b/crates/ty_python_semantic/src/types/infer/builder.rs index 59422dda27..ee687f651d 100644 --- a/crates/ty_python_semantic/src/types/infer/builder.rs +++ b/crates/ty_python_semantic/src/types/infer/builder.rs @@ -3531,7 +3531,7 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> { if known_instance.class(self.db()) == KnownClass::ParamSpec => { if let Some(diagnostic_builder) = - self.context.report_lint(&INVALID_TYPE_FORM, expr) + self.context.report_lint(&INVALID_TYPE_ARGUMENTS, expr) { diagnostic_builder.into_diagnostic(format_args!( "ParamSpec `{}` is unbound",