Skip to content

cmd/compile: improve error message when if statement brace is on next line #18747

@zigo101

Description

@zigo101

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.7.4 linux/amd64

What did you do?

package main

func main() {
	a := 1
	
	for a = 1; a < 2; a++ // syntax error: missing { after for clause
	{
	}
	
	if a == 1 // missing condition in if statement
	{
	}
}

What did you expect to see?

the two error messages should be alike.

What did you see instead?

the the second error message is not very accurate.

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