mirror of
https://github.com/vlang/v.git
synced 2025-09-18 11:56:57 -04:00
This commit is contained in:
parent
5cd84d4565
commit
335357239a
@ -7332,7 +7332,7 @@ fn (mut g Gen) or_block(var_name string, or_block ast.OrExpr, return_type ast.Ty
|
||||
// the deferred statements are generated.
|
||||
g.write_defer_stmts()
|
||||
// Now that option types are distinct we need a cast here
|
||||
if g.fn_decl.return_type == ast.void_type {
|
||||
if g.fn_decl == unsafe { nil } || g.fn_decl.return_type == ast.void_type {
|
||||
g.writeln('\treturn;')
|
||||
} else {
|
||||
styp := g.styp(g.fn_decl.return_type)
|
||||
@ -7360,7 +7360,7 @@ fn (mut g Gen) or_block(var_name string, or_block ast.OrExpr, return_type ast.Ty
|
||||
// the deferred statements are generated.
|
||||
g.write_defer_stmts()
|
||||
// Now that option types are distinct we need a cast here
|
||||
if g.fn_decl.return_type == ast.void_type {
|
||||
if g.fn_decl == unsafe { nil } || g.fn_decl.return_type == ast.void_type {
|
||||
g.writeln('\treturn;')
|
||||
} else {
|
||||
styp := g.styp(g.fn_decl.return_type).replace('*', '_ptr')
|
||||
|
16
vlib/v/tests/options/modules/mymod/mod.v
Normal file
16
vlib/v/tests/options/modules/mymod/mod.v
Normal file
@ -0,0 +1,16 @@
|
||||
// mod.v
|
||||
|
||||
module mymod
|
||||
|
||||
import math.big
|
||||
|
||||
pub struct BigintRange {
|
||||
pub mut:
|
||||
start big.Integer
|
||||
end big.Integer
|
||||
}
|
||||
|
||||
pub const range = BigintRange{
|
||||
start: big.integer_from_string('338288524927261089654018896841347694592')!
|
||||
end: big.integer_from_string('338620831926207318622244848606417780735')!
|
||||
}
|
7
vlib/v/tests/options/modules/mymod/mod_test.v
Normal file
7
vlib/v/tests/options/modules/mymod/mod_test.v
Normal file
@ -0,0 +1,7 @@
|
||||
// mod_test.v
|
||||
|
||||
module mymod
|
||||
|
||||
fn test_dummy() {
|
||||
assert range != BigintRange{}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user