Skip to content

go/printer: Source position broken #5945

@gopherbot

Description

@gopherbot

by tobias.schwerdtfeger:

What steps will reproduce the problem?
First issue:
The reported line numbers after function declarations or package XXX etc. with a
following blank newline are reported wrong (and probably shouldn't even displayed, or is
this intentional?).

Second issue:
Replacing function calls with a ast.NewIdent("") will result in an incorrect
and actually useless //line comment (line number shifted by -1).
Indirectly this issue affects cgo while reporting errors. (See
https://golang.org/issue/5674)

For both issues see:
http://play.golang.org/p/tlli7esWMO
"Output 1" describes the first issue and "Output 2" the second.

Which version are you using?  (run 'go version')
go version devel +84cafba689b1 Wed Jul 24 17:48:13 2013 +0900 linux/amd64

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions