Support struct values as constants #25

Open
opened 2025-08-27 10:08:42 +00:00 by Furkan · 0 comments

Constants work for integers and strings but doesn't work for custom structs

Color {
	r byte
	g byte
	b byte
	a byte
}

const {
	BLACK = Color{0, 0, 0, 255}
	WHITE = Color{255, 255, 255, 255}
}

main() {
}
Constants work for integers and strings but doesn't work for custom structs ``` Color { r byte g byte b byte a byte } const { BLACK = Color{0, 0, 0, 255} WHITE = Color{255, 255, 255, 255} } main() { } ```
ed self-assigned this 2025-08-27 10:23:14 +00:00
ed changed title from Couldn't define contant structs to Support structs as constants 2025-08-27 10:24:00 +00:00
ed changed title from Support structs as constants to Support struct values as constants 2025-08-27 10:24:19 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cli/q#25
No description provided.