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

all: use the new types with old syntax (#6922)

This commit is contained in:
Daniel Däschle
2020-11-24 13:58:29 +01:00
committed by GitHub
parent 8be9bdacd1
commit aa6303f0b2
22 changed files with 303 additions and 300 deletions

View File

@@ -8,7 +8,7 @@ import v.checker
import v.table
import v.pref
pub type Object = int | string
pub __type Object = int | string
pub struct Eval {
mut:
@@ -33,14 +33,14 @@ pub fn (mut e Eval) eval(file ast.File, table &table.Table) string {
}
fn print_object(o Object) {
match o {
match union o {
int { println(o) }
else { println('unknown object') }
}
}
pub fn (o Object) str() string {
match o {
match union o {
int { return o.str() }
else { println('unknown object') }
}