diff --git a/conformance/results/mypy/generics_scoping.toml b/conformance/results/mypy/generics_scoping.toml index 3c3e0054..013baaa7 100644 --- a/conformance/results/mypy/generics_scoping.toml +++ b/conformance/results/mypy/generics_scoping.toml @@ -1,26 +1,30 @@ output = """ -generics_scoping.py:29: error: Argument 1 to "meth_2" of "MyClass" has incompatible type "str"; expected "int" [arg-type] -generics_scoping.py:50: error: Type variable "generics_scoping.S" is unbound [valid-type] -generics_scoping.py:50: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) -generics_scoping.py:50: note: (Hint: Use "S" in function signature to bind "S" inside a function) -generics_scoping.py:54: error: Type variable "generics_scoping.S" is unbound [valid-type] -generics_scoping.py:54: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) -generics_scoping.py:54: note: (Hint: Use "S" in function signature to bind "S" inside a function) -generics_scoping.py:65: error: Free type variable expected in Generic[...] [misc] -generics_scoping.py:75: error: Type variable "T" is bound by an outer class [valid-type] -generics_scoping.py:78: error: Type variable "generics_scoping.T" is unbound [valid-type] -generics_scoping.py:78: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -generics_scoping.py:78: note: (Hint: Use "T" in function signature to bind "T" inside a function) -generics_scoping.py:87: error: Can't use bound type variable "T" to define generic alias [valid-type] -generics_scoping.py:94: error: Type variable "generics_scoping.T" is unbound [valid-type] -generics_scoping.py:94: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -generics_scoping.py:94: note: (Hint: Use "T" in function signature to bind "T" inside a function) -generics_scoping.py:95: error: Type variable "generics_scoping.T" is unbound [valid-type] -generics_scoping.py:95: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -generics_scoping.py:95: note: (Hint: Use "T" in function signature to bind "T" inside a function) -generics_scoping.py:96: error: Type variable "generics_scoping.T" is unbound [valid-type] -generics_scoping.py:96: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -generics_scoping.py:96: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_scoping.py:16: error: Expression is of type "int", not "Literal[1]" [assert-type] +generics_scoping.py:20: error: Expression is of type "str", not "Literal['a']" [assert-type] +generics_scoping.py:34: error: Argument 1 to "meth_2" of "MyClass" has incompatible type "str"; expected "int" [arg-type] +generics_scoping.py:50: error: Expression is of type "str", not "Literal['abc']" [assert-type] +generics_scoping.py:54: error: Expression is of type "bytes", not "Literal[b'abc']" [assert-type] +generics_scoping.py:61: error: Type variable "generics_scoping.S" is unbound [valid-type] +generics_scoping.py:61: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) +generics_scoping.py:61: note: (Hint: Use "S" in function signature to bind "S" inside a function) +generics_scoping.py:65: error: Type variable "generics_scoping.S" is unbound [valid-type] +generics_scoping.py:65: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) +generics_scoping.py:65: note: (Hint: Use "S" in function signature to bind "S" inside a function) +generics_scoping.py:76: error: Free type variable expected in Generic[...] [misc] +generics_scoping.py:86: error: Type variable "T" is bound by an outer class [valid-type] +generics_scoping.py:89: error: Type variable "generics_scoping.T" is unbound [valid-type] +generics_scoping.py:89: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_scoping.py:89: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_scoping.py:98: error: Can't use bound type variable "T" to define generic alias [valid-type] +generics_scoping.py:105: error: Type variable "generics_scoping.T" is unbound [valid-type] +generics_scoping.py:105: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_scoping.py:105: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_scoping.py:106: error: Type variable "generics_scoping.T" is unbound [valid-type] +generics_scoping.py:106: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_scoping.py:106: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_scoping.py:107: error: Type variable "generics_scoping.T" is unbound [valid-type] +generics_scoping.py:107: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_scoping.py:107: note: (Hint: Use "T" in function signature to bind "T" inside a function) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/generics_syntax_scoping.toml b/conformance/results/mypy/generics_syntax_scoping.toml index 2e249720..34cc33a0 100644 --- a/conformance/results/mypy/generics_syntax_scoping.toml +++ b/conformance/results/mypy/generics_syntax_scoping.toml @@ -19,18 +19,18 @@ generics_syntax_scoping.py:95: error: "T" already defined as a type parameter [ generics_syntax_scoping.py:98: error: "T" already defined as a type parameter [misc] generics_syntax_scoping.py:98: error: Variable "generics_syntax_scoping.ClassE.T" is not valid as a type [valid-type] generics_syntax_scoping.py:98: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:116: error: Expression is of type "Any", not "TypeVar" [assert-type] -generics_syntax_scoping.py:116: note: "assert_type" expects everything to be "Any" in unchecked functions -generics_syntax_scoping.py:121: error: Expression is of type "Any", not "complex" [assert-type] -generics_syntax_scoping.py:121: note: "assert_type" expects everything to be "Any" in unchecked functions -generics_syntax_scoping.py:124: error: Expression is of type "Any", not "complex" [assert-type] -generics_syntax_scoping.py:124: note: "assert_type" expects everything to be "Any" in unchecked functions +generics_syntax_scoping.py:117: error: Expression is of type "Any", not "TypeVar" [assert-type] +generics_syntax_scoping.py:117: note: "assert_type" expects everything to be "Any" in unchecked functions +generics_syntax_scoping.py:122: error: Expression is of type "Any", not "complex" [assert-type] +generics_syntax_scoping.py:122: note: "assert_type" expects everything to be "Any" in unchecked functions +generics_syntax_scoping.py:125: error: Expression is of type "Any", not "complex" [assert-type] +generics_syntax_scoping.py:125: note: "assert_type" expects everything to be "Any" in unchecked functions """ conformance_automated = "Fail" errors_diff = """ Line 62: Unexpected errors ['generics_syntax_scoping.py:62: error: Expression is of type "Any", not "str" [assert-type]'] Line 67: Unexpected errors ['generics_syntax_scoping.py:67: error: Expression is of type "Any", not "int" [assert-type]'] -Line 116: Unexpected errors ['generics_syntax_scoping.py:116: error: Expression is of type "Any", not "TypeVar" [assert-type]'] -Line 121: Unexpected errors ['generics_syntax_scoping.py:121: error: Expression is of type "Any", not "complex" [assert-type]'] -Line 124: Unexpected errors ['generics_syntax_scoping.py:124: error: Expression is of type "Any", not "complex" [assert-type]'] +Line 117: Unexpected errors ['generics_syntax_scoping.py:117: error: Expression is of type "Any", not "TypeVar" [assert-type]'] +Line 122: Unexpected errors ['generics_syntax_scoping.py:122: error: Expression is of type "Any", not "complex" [assert-type]'] +Line 125: Unexpected errors ['generics_syntax_scoping.py:125: error: Expression is of type "Any", not "complex" [assert-type]'] """ diff --git a/conformance/results/pyrefly/generics_scoping.toml b/conformance/results/pyrefly/generics_scoping.toml index f73633f3..a4d46cbf 100644 --- a/conformance/results/pyrefly/generics_scoping.toml +++ b/conformance/results/pyrefly/generics_scoping.toml @@ -4,16 +4,20 @@ Does not implement several scoping checks/restrictions for generics """ conformance_automated = "Fail" errors_diff = """ -Line 50: Expected 1 errors -Line 54: Expected 1 errors -Line 75: Expected 1 errors -Line 78: Expected 1 errors -Line 87: Expected 1 errors -Line 94: Expected 1 errors -Line 95: Expected 1 errors -Line 96: Expected 1 errors +Line 61: Expected 1 errors +Line 65: Expected 1 errors +Line 86: Expected 1 errors +Line 89: Expected 1 errors +Line 98: Expected 1 errors +Line 105: Expected 1 errors +Line 106: Expected 1 errors +Line 107: Expected 1 errors """ output = """ -ERROR generics_scoping.py:29:10-13: Argument `Literal['a']` is not assignable to parameter `x` with type `int` in function `MyClass.meth_2` [bad-argument-type] -ERROR generics_scoping.py:65:11-20: Redundant type parameter declaration [invalid-type-var] +ERROR generics_scoping.py:16:12-34: assert_type(int, Literal[1]) failed [assert-type] +ERROR generics_scoping.py:20:12-38: assert_type(str, Literal['a']) failed [assert-type] +ERROR generics_scoping.py:34:10-13: Argument `Literal['a']` is not assignable to parameter `x` with type `int` in function `MyClass.meth_2` [bad-argument-type] +ERROR generics_scoping.py:50:12-48: assert_type(str, Literal['abc']) failed [assert-type] +ERROR generics_scoping.py:54:12-50: assert_type(bytes, Literal[b'abc']) failed [assert-type] +ERROR generics_scoping.py:76:11-20: Redundant type parameter declaration [invalid-type-var] """ diff --git a/conformance/results/pyright/generics_scoping.toml b/conformance/results/pyright/generics_scoping.toml index 2e352ca7..9e73f07d 100644 --- a/conformance/results/pyright/generics_scoping.toml +++ b/conformance/results/pyright/generics_scoping.toml @@ -1,16 +1,20 @@ conformant = "Pass" output = """ -generics_scoping.py:29:10 - error: Argument of type "Literal['a']" cannot be assigned to parameter "x" of type "int" in function "meth_2" +generics_scoping.py:16:13 - error: "assert_type" mismatch: expected "Literal[1]" but received "int" (reportAssertTypeFailure) +generics_scoping.py:20:13 - error: "assert_type" mismatch: expected "Literal['a']" but received "str" (reportAssertTypeFailure) +generics_scoping.py:34:10 - error: Argument of type "Literal['a']" cannot be assigned to parameter "x" of type "int" in function "meth_2" "Literal['a']" is not assignable to "int" (reportArgumentType) -generics_scoping.py:50:13 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) -generics_scoping.py:54:19 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) -generics_scoping.py:65:29 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) -generics_scoping.py:75:24 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) -generics_scoping.py:78:17 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) -generics_scoping.py:87:5 - error: Generic type alias within class cannot use bound type variables T (reportInvalidTypeForm) -generics_scoping.py:94:14 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) -generics_scoping.py:95:19 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) -generics_scoping.py:96:6 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) +generics_scoping.py:50:13 - error: "assert_type" mismatch: expected "Literal['abc']" but received "str" (reportAssertTypeFailure) +generics_scoping.py:54:13 - error: "assert_type" mismatch: expected "Literal[b"abc"]" but received "bytes" (reportAssertTypeFailure) +generics_scoping.py:61:13 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) +generics_scoping.py:65:19 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) +generics_scoping.py:76:29 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) +generics_scoping.py:86:24 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) +generics_scoping.py:89:17 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) +generics_scoping.py:98:5 - error: Generic type alias within class cannot use bound type variables T (reportInvalidTypeForm) +generics_scoping.py:105:14 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) +generics_scoping.py:106:19 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) +generics_scoping.py:107:6 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 72964529..f5006fbc 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -307,7 +307,7 @@
Does not implement several scoping checks/restrictions for generics