mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
@ for escaping keywords
This commit is contained in:
@ -21,6 +21,10 @@ struct User {
|
||||
name string
|
||||
age int
|
||||
}
|
||||
|
||||
struct Foo {
|
||||
@type string
|
||||
}
|
||||
|
||||
fn test_struct_levels() {
|
||||
mut c := C{}
|
||||
@ -54,3 +58,8 @@ fn test_struct_str() {
|
||||
println(u) // make sure the struct is printable
|
||||
// assert u.str() == '{name:"Bob", age:30}' // TODO
|
||||
}
|
||||
|
||||
fn test_at() {
|
||||
foo := Foo{ @type: 'test' }
|
||||
println(foo.@type)
|
||||
}
|
||||
|
Reference in New Issue
Block a user