diff --git a/conformance/results/mypy/generics_type_erasure.toml b/conformance/results/mypy/generics_type_erasure.toml index dd13b446..a37b9c98 100644 --- a/conformance/results/mypy/generics_type_erasure.toml +++ b/conformance/results/mypy/generics_type_erasure.toml @@ -1,7 +1,6 @@ conformant = "Partial" notes = """ Infers `Node[Never]` instead of `Node[Any]` when argument is not provided. -False negative on instance attribute access on `type(node)`. """ output = """ generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type] @@ -15,7 +14,6 @@ generics_type_erasure.py:45: error: Access to generic instance variables via cla """ conformance_automated = "Fail" errors_diff = """ -Line 46: Expected 1 errors Line 19: Unexpected errors ['generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type]'] Line 22: Unexpected errors ['generics_type_erasure.py:22: error: Expression is of type "Never", not "Any" [assert-type]'] """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 2c57ab56..05085ecd 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -766,7 +766,6 @@

Python Type System Conformance Test Results

Partial Pass diff --git a/conformance/results/ty/generics_type_erasure.toml b/conformance/results/ty/generics_type_erasure.toml index 0d180a39..0348dcfd 100644 --- a/conformance/results/ty/generics_type_erasure.toml +++ b/conformance/results/ty/generics_type_erasure.toml @@ -8,7 +8,6 @@ Line 42: Expected 1 errors Line 43: Expected 1 errors Line 44: Expected 1 errors Line 45: Expected 1 errors -Line 46: Expected 1 errors """ output = """ generics_type_erasure.py:38:16: error[invalid-argument-type] Argument to `Node.__init__` is incorrect: Expected `int | None`, found `Literal[""]` diff --git a/conformance/tests/generics_type_erasure.py b/conformance/tests/generics_type_erasure.py index c7462259..b78f2924 100644 --- a/conformance/tests/generics_type_erasure.py +++ b/conformance/tests/generics_type_erasure.py @@ -43,7 +43,7 @@ def __init__(self, label: T | None = None) -> None: Node[int].label # E Node.label = 1 # E Node.label # E -type(n1).label # E +type(n1).label # E? assert_type(n1.label, int) assert_type(Node[int]().label, int) n1.label = 1 # OK diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index 7f6cbb92..6670b6c6 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -400,7 +400,6 @@ class instance that does not have an instance attribute with the same name:: Node[int].x # Error Node.x = 1 # Error Node.x # Error - type(p).x # Error p.x # Ok (evaluates to int) Node[int]().x # Ok (evaluates to int) p.x = 1 # Ok, but assigning to instance attribute