Closed
Description
repro:
# from typing import Optional # uncomment for CPython; comment for LPython
NEWLINE : str = "\n"
WHITESPACE : list[str] = [" ", ",", NEWLINE, "\r", "\t"]
def match(pat : str, string : str) -> Optional[list[str] | str]:
return None
produces:
└─(06:39:53 on brian-lasr ✹ ✭)──> ~/CLionProjects/lpython/src/bin/lpython -I. lasr_lexer_optional_list.py 2 ↵ ──(Mon,Jun19)─┘
semantic error: Variable 'list' not declared
--> lasr_lexer_optional_list.py:7:48
|
7 | def match(pat : str, string : str) -> Optional[list[str] | str]:
| ^^^^