Describe the bug
Multiline syntax that is normally invalid is accepted inside stringized annotations.
Code or Screenshots
If possible, provide a minimal, self-contained code sample (surrounded by triple back ticks) to demonstrate the issue. The code should define or import all referenced symbols.
from typing_extensions import TypeAlias
Alias1 = (
int
| str
| bool
) # parentheses required
Alias2: TypeAlias = """
int
| str
| bool
""" # mypy: Invalid type comment or annotation [valid-type]
# ruff (a linter): [F722] Syntax error in forward annotation
# pyright: 0 errors, 0 warnings, 0 informations
VS Code extension or command-line
Command line, 1.1.345