Skip to content

Commit 0802d7f

Browse files
gvanrossumddfisher
authored andcommitted
Copy line number to func_type. (#1845)
With `--fast-parser` I got a bunch of errors without line numbers (in particular `The return type of a generator function should be "Generator" or one of its supertypes`). I tracked it down to this place.
1 parent 0a9d9cb commit 0802d7f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mypy/fastparse.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ def visit_FunctionDef(self, n: ast35.FunctionDef) -> Node:
287287
func_type)
288288
if func_type is not None:
289289
func_type.definition = func_def
290+
func_type.line = n.lineno
290291

291292
if n.decorator_list:
292293
var = Var(func_def.name())

0 commit comments

Comments
 (0)