Skip to content

cgen: fix struct field name using c keyword typeof (fix #22779) - #22782

Merged
spytheman merged 1 commit into
vlang:masterfrom
yuyi98:check_using_c_reserved
Nov 7, 2024
Merged

spytheman merged 1 commit into
vlang:masterfrom
yuyi98:check_using_c_reserved

Conversation

@yuyi98

@yuyi98 yuyi98 commented Nov 7, 2024 •

Copy link
Copy Markdown
Member

This PR fix struct field name using c keyword typeof (fix #22779).

  • Fix struct field name using c keyword typeof.
  • Add test.
struct Keywords {
	typeof u8
}

fn main() {
	key := Keywords{}
	println(key)
}

PS D:\Test\v\tt1> v run .
Keywords{
    typeof: 0
}

Huly®: V_0.6-21228

@felipensp

Copy link
Copy Markdown
Member

Please, rebase over master 👍🏻

@yuyi98
yuyi98 force-pushed the check_using_c_reserved branch from 580cc64 to 83dd010 Compare November 7, 2024 02:34

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman
spytheman merged commit 505a247 into vlang:master Nov 7, 2024
@yuyi98
yuyi98 deleted the check_using_c_reserved branch November 7, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

typeof keyword in struct filed produces c error

3 participants