Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conformance test for @final combined with @property #1916

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions conformance/results/mypy/qualifiers_final_decorator.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
conformant = "Pass"
output = """
qualifiers_final_decorator.py:21: error: Cannot inherit from final class "Base1" [misc]
qualifiers_final_decorator.py:56: error: Cannot override final attribute "method1" (previously declared in base class "Base2") [misc]
qualifiers_final_decorator.py:59: error: Cannot override final attribute "method2" (previously declared in base class "Base2") [misc]
qualifiers_final_decorator.py:63: error: Cannot override final attribute "method3" (previously declared in base class "Base2") [misc]
qualifiers_final_decorator.py:67: error: Cannot override final attribute "method4" (previously declared in base class "Base2") [misc]
qualifiers_final_decorator.py:80: error: Cannot override final attribute "method" (previously declared in base class "Base3") [misc]
qualifiers_final_decorator.py:84: error: @final should be applied only to overload implementation [misc]
qualifiers_final_decorator.py:94: error: Cannot override final attribute "method" (previously declared in base class "Base4") [misc]
qualifiers_final_decorator.py:118: error: Cannot override final attribute "method" (previously declared in base class "Base5_2") [misc]
qualifiers_final_decorator.py:118: error: Signature of "method" incompatible with supertype "Base5_2" [override]
qualifiers_final_decorator.py:118: note: Superclass:
qualifiers_final_decorator.py:118: note: def method(self, v: int) -> None
qualifiers_final_decorator.py:118: note: Subclass:
qualifiers_final_decorator.py:118: note: def method(self) -> None
qualifiers_final_decorator.py:125: error: @final cannot be used with non-method functions [misc]
qualifiers_final_decorator.py:64: error: Cannot override final attribute "method1" (previously declared in base class "Base2") [misc]
qualifiers_final_decorator.py:67: error: Cannot override final attribute "method2" (previously declared in base class "Base2") [misc]
qualifiers_final_decorator.py:71: error: Cannot override final attribute "method3" (previously declared in base class "Base2") [misc]
qualifiers_final_decorator.py:75: error: Cannot override final attribute "method4" (previously declared in base class "Base2") [misc]
qualifiers_final_decorator.py:86: error: Cannot override final attribute "method5" (previously declared in base class "Base2") [misc]
qualifiers_final_decorator.py:92: error: Cannot override final attribute "method" (previously declared in base class "Base3") [misc]
qualifiers_final_decorator.py:96: error: @final should be applied only to overload implementation [misc]
qualifiers_final_decorator.py:106: error: Cannot override final attribute "method" (previously declared in base class "Base4") [misc]
qualifiers_final_decorator.py:130: error: Cannot override final attribute "method" (previously declared in base class "Base5_2") [misc]
qualifiers_final_decorator.py:130: error: Signature of "method" incompatible with supertype "Base5_2" [override]
qualifiers_final_decorator.py:130: note: Superclass:
qualifiers_final_decorator.py:130: note: def method(self, v: int) -> None
qualifiers_final_decorator.py:130: note: Subclass:
qualifiers_final_decorator.py:130: note: def method(self) -> None
qualifiers_final_decorator.py:137: error: @final cannot be used with non-method functions [misc]
"""
conformance_automated = "Pass"
errors_diff = """
Expand Down
4 changes: 2 additions & 2 deletions conformance/results/mypy/version.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "mypy 1.14.0"
test_duration = 1.6
version = "mypy 1.14.1"
test_duration = 3.3
21 changes: 11 additions & 10 deletions conformance/results/pyre/qualifiers_final_decorator.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ Reports misleading error when overload is marked @final but implementation is no
output = """
qualifiers_final_decorator.py:21:0 Invalid inheritance [39]: Cannot inherit from final class `Base1`.
qualifiers_final_decorator.py:51:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
qualifiers_final_decorator.py:56:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method1` cannot override final method defined in `Base2`.
qualifiers_final_decorator.py:60:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method2` cannot override final method defined in `Base2`.
qualifiers_final_decorator.py:64:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method3` cannot override final method defined in `Base2`.
qualifiers_final_decorator.py:75:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method4` cannot override final method defined in `Base2`.
qualifiers_final_decorator.py:86:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
qualifiers_final_decorator.py:118:4 Inconsistent override [14]: `qualifiers_final_decorator.Derived5.method` overrides method defined in `Base5_2` inconsistently. Could not find parameter `v` in overriding signature.
qualifiers_final_decorator.py:118:4 Invalid override [40]: `qualifiers_final_decorator.Derived5.method` cannot override final method defined in `Base5_2`.
qualifiers_final_decorator.py:126:0 Invalid inheritance [39]: `final` cannot be used with non-method functions.
qualifiers_final_decorator.py:64:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method1` cannot override final method defined in `Base2`.
qualifiers_final_decorator.py:68:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method2` cannot override final method defined in `Base2`.
qualifiers_final_decorator.py:72:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method3` cannot override final method defined in `Base2`.
qualifiers_final_decorator.py:83:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method4` cannot override final method defined in `Base2`.
qualifiers_final_decorator.py:98:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
qualifiers_final_decorator.py:130:4 Inconsistent override [14]: `qualifiers_final_decorator.Derived5.method` overrides method defined in `Base5_2` inconsistently. Could not find parameter `v` in overriding signature.
qualifiers_final_decorator.py:130:4 Invalid override [40]: `qualifiers_final_decorator.Derived5.method` cannot override final method defined in `Base5_2`.
qualifiers_final_decorator.py:138:0 Invalid inheritance [39]: `final` cannot be used with non-method functions.
"""
conformance_automated = "Fail"
errors_diff = """
Lines 80, 89: Expected error (tag 'Derived3')
Lines 94, 102: Expected error (tag 'Derived4')
Lines 86, 87: Expected error (tag 'method5')
Lines 92, 101: Expected error (tag 'Derived3')
Lines 106, 114: Expected error (tag 'Derived4')
Line 51: Unexpected errors ['qualifiers_final_decorator.py:51:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
"""
2 changes: 1 addition & 1 deletion conformance/results/pyre/version.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "pyre 0.9.23"
test_duration = 7.3
test_duration = 10.0
10 changes: 5 additions & 5 deletions conformance/results/pyright/aliases_explicit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ aliases_explicit.py:79:21 - error: Invalid expression form for type alias defini
aliases_explicit.py:79:21 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
aliases_explicit.py:80:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm)
aliases_explicit.py:80:21 - error: List expression not allowed in type expression
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
aliases_explicit.py:80:21 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues)
aliases_explicit.py:81:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm)
aliases_explicit.py:81:21 - error: Tuple expression not allowed in type expression
  Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
aliases_explicit.py:82:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm)
aliases_explicit.py:82:21 - error: List expression not allowed in type expression
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
aliases_explicit.py:82:21 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
aliases_explicit.py:83:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm)
aliases_explicit.py:83:21 - error: Dictionary expression not allowed in type expression
  Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm)
  Use dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm)
aliases_explicit.py:83:21 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues)
aliases_explicit.py:83:28 - error: "b" is not defined (reportUndefinedVariable)
aliases_explicit.py:84:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm)
aliases_explicit.py:84:21 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
aliases_explicit.py:85:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm)
aliases_explicit.py:85:21 - error: List expression not allowed in type expression
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
aliases_explicit.py:85:21 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
aliases_explicit.py:85:27 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues)
aliases_explicit.py:86:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm)
Expand Down
10 changes: 5 additions & 5 deletions conformance/results/pyright/aliases_type_statement.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ aliases_type_statement.py:31:22 - error: Argument of type "TypeAliasType" cannot
    "TypeAliasType" is not assignable to "tuple[_ClassInfo, ...]" (reportArgumentType)
aliases_type_statement.py:37:22 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
aliases_type_statement.py:38:22 - error: List expression not allowed in type expression
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
aliases_type_statement.py:38:22 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues)
aliases_type_statement.py:39:22 - error: Tuple expression not allowed in type expression
  Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
aliases_type_statement.py:40:22 - error: List expression not allowed in type expression
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
aliases_type_statement.py:40:22 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
aliases_type_statement.py:41:22 - error: Dictionary expression not allowed in type expression
  Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm)
  Use dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm)
aliases_type_statement.py:41:22 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues)
aliases_type_statement.py:41:29 - error: "b" is not defined (reportUndefinedVariable)
aliases_type_statement.py:42:22 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
aliases_type_statement.py:43:22 - error: List expression not allowed in type expression
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
aliases_type_statement.py:43:22 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
aliases_type_statement.py:43:28 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues)
aliases_type_statement.py:44:22 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm)
Expand Down
2 changes: 1 addition & 1 deletion conformance/results/pyright/aliases_typealiastype.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ aliases_typealiastype.py:56:42 - error: Expected class but received "dict[str, U
aliases_typealiastype.py:56:49 - error: "b" is not defined (reportUndefinedVariable)
aliases_typealiastype.py:57:42 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
aliases_typealiastype.py:58:42 - error: List expression not allowed in type expression
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
aliases_typealiastype.py:58:42 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
aliases_typealiastype.py:58:48 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues)
aliases_typealiastype.py:59:42 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm)
Expand Down
10 changes: 5 additions & 5 deletions conformance/results/pyright/annotations_forward_refs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ annotations_forward_refs.py:24:7 - error: Union syntax cannot be used with strin
annotations_forward_refs.py:25:13 - error: Union syntax cannot be used with string operand; use quotes around entire expression (reportGeneralTypeIssues)
annotations_forward_refs.py:41:10 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
annotations_forward_refs.py:42:10 - error: List expression not allowed in type expression
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
annotations_forward_refs.py:42:10 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues)
annotations_forward_refs.py:43:10 - error: Tuple expression not allowed in type expression
  Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
annotations_forward_refs.py:44:10 - error: List expression not allowed in type expression
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
annotations_forward_refs.py:44:10 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
annotations_forward_refs.py:45:10 - error: Dictionary expression not allowed in type expression
  Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm)
  Use dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm)
annotations_forward_refs.py:45:10 - error: Expected class but received "dict[Unknown, Unknown]" (reportGeneralTypeIssues)
annotations_forward_refs.py:46:10 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
annotations_forward_refs.py:47:10 - error: List expression not allowed in type expression
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
annotations_forward_refs.py:47:10 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
annotations_forward_refs.py:47:16 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues)
annotations_forward_refs.py:48:10 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm)
Expand Down
10 changes: 5 additions & 5 deletions conformance/results/pyright/annotations_typeexpr.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ conformant = "Pass"
output = """
annotations_typeexpr.py:88:9 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
annotations_typeexpr.py:89:9 - error: List expression not allowed in type expression
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
annotations_typeexpr.py:89:9 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues)
annotations_typeexpr.py:90:9 - error: Tuple expression not allowed in type expression
  Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
annotations_typeexpr.py:91:9 - error: List expression not allowed in type expression
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
annotations_typeexpr.py:91:9 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
annotations_typeexpr.py:92:9 - error: Dictionary expression not allowed in type expression
  Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm)
  Use dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm)
annotations_typeexpr.py:92:9 - error: Expected class but received "dict[Unknown, Unknown]" (reportGeneralTypeIssues)
annotations_typeexpr.py:93:9 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
annotations_typeexpr.py:94:9 - error: List expression not allowed in type expression
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
annotations_typeexpr.py:94:9 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
annotations_typeexpr.py:94:15 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues)
annotations_typeexpr.py:95:9 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ generics_syntax_declarations.py:32:11 - error: Cannot access attribute "is_integ
  Attribute "is_integer" is unknown (reportAttributeAccessIssue)
generics_syntax_declarations.py:44:21 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues)
generics_syntax_declarations.py:48:17 - error: List expression not allowed in type expression
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
generics_syntax_declarations.py:48:17 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues)
generics_syntax_declarations.py:60:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues)
generics_syntax_declarations.py:64:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues)
Expand Down
Loading