WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit aec4db2

Browse files
committed
Add a test case for abstract class with class var
1 parent 184b168 commit aec4db2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pyrefly/lib/test/abstract_methods.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,3 +417,16 @@ class D(C): # E: Class `D` has unimplemented abstract members: `bar`
417417
yield 1
418418
"#,
419419
);
420+
421+
422+
testcase!(
423+
test_uninit_classvar_abc,
424+
r#"
425+
from abc import ABC
426+
from typing import ClassVar, final
427+
@final
428+
class A(ABC): # E: Final class `A` cannot have unimplemented abstract members: `x`
429+
x: ClassVar[int]
430+
a = A() # E: Cannot instantiate `A` because the following members are abstract: `x`
431+
"#,
432+
);

0 commit comments

Comments
 (0)