-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Problem
Updating github.com/goplus/gogen from v1.19.7 to v1.20.2 causes multiple TestFromTestdata tests to fail with compilation errors related to block comment formatting.
How to Reproduce
- In
go.mod, change gogen dependency:
- github.com/goplus/gogen v1.19.7
+ github.com/goplus/gogen v1.20.2-
Run
go mod tidy -
Run tests:
go test ./cl/internal/convert/ -run TestFromTestdata -vError Messages
TestFromTestdata/gettext
expected declaration, found The
TestFromTestdata/gpgerror
expected declaration, found '*'
TestFromTestdata/issue507
Multiple block comment syntax errors
TestFromTestdata/keepcomment
comment not terminated
Root Cause
These errors occur because multi-line C block comments like:
/* Create an iterator for traversing a domain
The domain NULL denotes the default domain */Are split into multiple ast.Comment nodes (one per line) instead of a single node. With gogen v1.20.2, the Go printer now strictly follows the ast.Comment specification and produces invalid Go code from these incorrectly split comments.
Example of invalid generated output with gogen v1.20.2:
/* Create an iterator for traversing a domain
*/ The domain NULL denotes the default domain */
*/func ExampleFunction() {
}Related
- Bug: gogen v1.20.2 update exposes comment parsing issue causing test failures #618 - Original issue tracking this bug
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels