Skip to content

Commit 175fae5

Browse files
committed
Add typing in check_is_declared_explicit()
1 parent fad4f18 commit 175fae5

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/api/check.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def check_type(lineno, type_list, arg):
6666
return False
6767

6868

69-
def check_is_declared_explicit(lineno: int, id_: str, classname: str = 'variable'):
69+
def check_is_declared_explicit(lineno: int, id_: str, classname: str = 'variable') -> bool:
7070
""" Check if the current ID is already declared.
7171
If not, triggers a "undeclared identifier" error,
7272
if the --explicit command line flag is enabled (or #pragma
@@ -77,8 +77,7 @@ def check_is_declared_explicit(lineno: int, id_: str, classname: str = 'variable
7777
if not config.OPTIONS.explicit:
7878
return True
7979

80-
entry = global_.SYMBOL_TABLE.check_is_declared(id_, lineno, classname)
81-
return entry is not None # True if declared
80+
return global_.SYMBOL_TABLE.check_is_declared(id_, lineno, classname)
8281

8382

8483
def check_type_is_explicit(lineno: int, id_: str, type_):

0 commit comments

Comments
 (0)