You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All references to an imported object share the same ONAME Node, so their line numbers (at least currently) have to correspond to the definition line rather than the usage line.
It looks like this should just be a matter of avoiding the s.pushLine(n.Lineno) call in (*state).expr for ONAME Nodes. Maybe for named OLITERAL Nodes too.
When I compile this with SSA, I get:
Note the line number. It's the line number of the
import
statement, not the line number whereos.Stdout
is mentioned.This bug comes from earlier in the pipeline than the SSA backend. On input to SSA, we have:
Note the
l(3)
on the os.Stdout reference.I suspect the old compiler ends up using the line number of the AS, so it is ok, whereas the SSA compiler uses the line number for the NAME.
Probably a dup of #14742
See issue #15427
@davecheney
The text was updated successfully, but these errors were encountered: