mirror of
https://github.com/vlang/v.git
synced 2025-09-15 15:32:27 +03:00
type alias check
This commit is contained in:
parent
2e23592264
commit
fc33f9d49c
3 changed files with 30 additions and 4 deletions
15
vlib/compiler/tests/type_alias_test.v
Normal file
15
vlib/compiler/tests/type_alias_test.v
Normal file
|
@ -0,0 +1,15 @@
|
|||
|
||||
type Myint int
|
||||
type Myf32 f32
|
||||
type Myf64 f64
|
||||
|
||||
fn test_type_alias() {
|
||||
i := Myint(10)
|
||||
assert i + 100 == 110
|
||||
|
||||
f := Myf32(1.0)
|
||||
assert f + 3.14 == 4.14
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue