Skip to content

Pyrefly ignores suppressions after multi-line nested strings in f-strings #4118

Description

@QEDady

Describe the Bug

Pyrefly fails to recognize ignore comments if they appear after an f-string that contains a nested triple-quoted string spanning multiple lines e.g.

# Corrupt the state with nested triple quotes in f-string
_ = f'start{"""message
"""}end'
y: int = "hello"  # pyrefly: ignore[bad-assignment]

Pyrefly still errors in the last line.

Sandbox Link

https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIAxAAQDCuATgwK7EAu1bAFjNXG6ja8A7hG7V08IZk4MIxWNQCOzXELjUI6amAC0-OegDmAHXQB9agF4dAcn6oGbYCZCvXAW3hojMM%2B7cQAF8YLFt-dDNSRE10DhtXHigoXFdqahoyBhgwKGjNI3RGXmxUTF1UODgIQq84sxAAGhAsnLzCNlwPKAoaAAVSbNzSPgwcAmoAY1x0SCNmBkEIGcIzGgBlGF4uNjZiOEQAekPW4cJGI0PQw8xcSbhD6dmahaWZw51GalQAN1RoVDYRRPOavNjLbS4dgQuCrdBkbgzXQ-GAMaozazUVwAZkIAEYAEzudAAbVRDEYcAAumZmOgIB5iIxpLpMBBspNwSjMbYakVsuF0EU2Lpsip2TBygBrGCkCqTSbeHnCRzoQXBZqoTkQFEAMWgMAoaCweCIZGCQA

(Only applicable for extension issues) IDE Information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

googleissues from googlehelp wantedLarger than "good first issue", but still well-defined and ready for someone to pick upstale

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions