1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v2: start impl multi assign

This commit is contained in:
joe-conigliaro
2020-02-07 03:38:02 +11:00
committed by GitHub
parent 65744207fc
commit 67a13fc916
9 changed files with 206 additions and 62 deletions

View File

@@ -77,6 +77,54 @@ pub enum Kind {
unresolved
}
[inline]
pub fn(t &Type) mr_info() MultiReturn {
match t.info {
MultiReturn {
return it
}
else {
panic('Type.mr_info(): no multi return info')
}
}
}
[inline]
pub fn(t &Type) array_info() Array {
match t.info {
Array {
return it
}
else {
panic('Type.mr_info(): no array info')
}
}
}
[inline]
pub fn(t &Type) array_fixed_info() ArrayFixed {
match t.info {
ArrayFixed {
return it
}
else {
panic('Type.mr_info(): no array fixed info')
}
}
}
[inline]
pub fn(t &Type) map_info() Map {
match t.info {
Map {
return it
}
else {
panic('Type.mr_info(): no map info')
}
}
}
/*
pub fn (t Type) str() string {
return t.name
@@ -395,6 +443,7 @@ pub mut:
pub struct MultiReturn {
pub:
name string
mut:
types []TypeRef
}