Skip to content

Capitals in the struct field names with type aliasing #24284

Description

@maiolika

Describe the bug

Compiler enforces you to use snake_case in struct field names.
But when you make one with type you can use capitals.

Reproduction Steps

struct Struct1 {
 	field_One int _// no, you can't_
 	field_two int
}
// error: field name `fieldOne` cannot contain uppercase letters, use snake_case instead

type Struct2 = struct {
	field_One int // yes, you can
	field_two int
}

Expected Behavior

For Struct2 // error: field name fieldOne cannot contain uppercase letters, use snake_case instead

Current Behavior

You get

Struct2(struct {
    field_One: 1
    field_two: 0
})

Possible Solution

No response

Additional Information/Context

No response

V version

Current V version: V 0.4.10 188d68d, timestamp: 2025-04-20 03:25:56 +0300

Environment details (OS name and version, etc.)

Windows 10 Home 22H2 19045.5737

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Metadata

Metadata

Assignees

Labels

BugThis tag is applied to issues which reports bugs.Status: ConfirmedThis bug has been confirmed to be valid by a contributor.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions