Skip to content

A bad error message on C-like for loop. #18445

Closed

Description

@mahocitrus

Describe the bug

A bad error message.(according to the admin on tg)

Expected Behavior

a better error message.

Current Behavior

test.v:3:9: error: unexpected token `;`, expecting `{`
    1 | fn main() {
    2 |     i := 0
    3 |     for i++; i < 10; i++ {
      |            ^
    4 |         println(i)
    5 |     }

Reproduction Steps

fn main() {
	i := 0
	for i++; i < 10; i++ {
		println(i)
	}
}

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.3.4 7f178d4

Environment details (OS name and version, etc.)

OS: windows, Microsoft Windows 10 Pro v19045 64-bit

Activity

  1. added
    BugThis tag is applied to issues which reports bugs.
    on Jun 14, 2023
  2. self-assigned this
    on Jun 14, 2023
  3. added a commit that references this issue on Aug 2, 2023
    1d9835f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugThis tag is applied to issues which reports bugs.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions