Can not use type
as field name of a custom type
#1796
Answered
by
lpil
xhh
asked this question in
Questions & support
-
type MyType {
Big
Small
}
type MyData {
MyData(type: MyType) // <--- compile error
} Would it be better to allow this use case? |
Beta Was this translation helpful? Give feedback.
Answered by
lpil
Oct 14, 2022
Replies: 1 comment 2 replies
-
Hello! I tend to use |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
xhh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
type
is a keyword so it cannot be used as a variable. It is quite common for languages not to permit keywords to be used as variable names.I tend to use
type_
in my Gleam and Rust programs intead.