mirror of
https://github.com/github/codeql.git
synced 2025-12-19 18:33:16 +01:00
Should fix #2426. Essentially, we disregard expressions used inside annotations, if these annotations occur in a file that has `from __future__ import annotations`, as this prevents the annotations from being evaluated.
12 lines
197 B
Python
12 lines
197 B
Python
from __future__ import annotations
|
|
|
|
import dataclasses
|
|
import typing
|
|
|
|
import module1
|
|
|
|
@dataclasses.dataclass()
|
|
class Bar:
|
|
def is_in_foo(self, foo: module1.Foo):
|
|
return self in foo.bars
|