Skip to content

Commit b0089db

Browse files
rchen152facebook-github-bot
authored andcommitted
Add test case for issue #934
Reviewed By: yangdanny97 Differential Revision: D80379943 fbshipit-source-id: 223dc9af77d60e63efb523b4d98f1d4070fe7b0a
1 parent ee70928 commit b0089db

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pyrefly/lib/test/named_tuple.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,3 +347,17 @@ class B(A):
347347
return super().__init__(x, y)
348348
"#,
349349
);
350+
351+
testcase!(
352+
bug = "The asserted type is wrong",
353+
test_custom_iter,
354+
r#"
355+
from typing import assert_type, Iterator, NamedTuple
356+
class NT(NamedTuple):
357+
x: int
358+
def __iter__(self) -> Iterator[str]: ...
359+
nt = NT(0)
360+
for x in nt:
361+
assert_type(x, str) # E: assert_type(int, str)
362+
"#,
363+
);

0 commit comments

Comments
 (0)