From 5cfde2e9f3cefce742082c0457f21fb65d7e1dfc Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 1 Mar 2026 00:19:50 +0300 Subject: [PATCH] v2: sum type test --- cmd/v2/test_sumtype_many.v | 93 +++++++++++++++++++++++++++++++------- 1 file changed, 77 insertions(+), 16 deletions(-) diff --git a/cmd/v2/test_sumtype_many.v b/cmd/v2/test_sumtype_many.v index 19b675f55..bc5400ba1 100644 --- a/cmd/v2/test_sumtype_many.v +++ b/cmd/v2/test_sumtype_many.v @@ -3,21 +3,79 @@ struct Pos { y int } -struct V0 { pos Pos; a int } -struct V1 { pos Pos; b int } -struct V2 { pos Pos; c int } -struct V3 { pos Pos; d int } -struct V4 { pos Pos; e int } -struct V5 { pos Pos; f int } -struct V6 { pos Pos; g int } -struct V7 { pos Pos; h int } -struct V8 { dummy u8 } // EmptyExpr equivalent (tag 8) -struct V9 { pos Pos; j int } -struct V10 { pos Pos; k int } -struct V11 { pos Pos; l int } -struct V12 { pos Pos; m int } -struct V13 { pos Pos; name string } // Ident equivalent (tag 13) -struct V14 { pos Pos; n int } +struct V0 { + pos Pos + a int +} + +struct V1 { + pos Pos + b int +} + +struct V2 { + pos Pos + c int +} + +struct V3 { + pos Pos + d int +} + +struct V4 { + pos Pos + e int +} + +struct V5 { + pos Pos + f int +} + +struct V6 { + pos Pos + g int +} + +struct V7 { + pos Pos + h int +} + +struct V8 { + dummy u8 +} // EmptyExpr equivalent (tag 8) + +struct V9 { + pos Pos + j int +} + +struct V10 { + pos Pos + k int +} + +struct V11 { + pos Pos + l int +} + +struct V12 { + pos Pos + m int +} + +struct V13 { + pos Pos + name string +} // Ident equivalent (tag 13) + +struct V14 { + pos Pos + n int +} type Expr = V0 | V1 | V2 | V3 | V4 | V5 | V6 | V7 | V8 | V9 | V10 | V11 | V12 | V13 | V14 @@ -43,7 +101,10 @@ fn (e Expr) get_pos() Pos { fn make_v13() Expr { return Expr(V13{ - pos: Pos{x: 42, y: 99} + pos: Pos{ + x: 42 + y: 99 + } name: 'hello' }) } -- 2.39.5