option: increase the temporary limit

pull/1416/head
Alexander Medvednikov 2019-08-01 01:19:45 +02:00 committed by GitHub
parent cd49c2103b
commit eb313ebb5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -5,15 +5,15 @@
module builtin module builtin
struct Option { struct Option {
data [255] byte data [500]byte
error string error string
ok bool ok bool
} }
// `fn foo() ?Foo { return foo }` => `fn foo() ?Foo { return opt_ok(foo); }` // `fn foo() ?Foo { return foo }` => `fn foo() ?Foo { return opt_ok(foo); }`
fn opt_ok(data voidptr, size int) Option { fn opt_ok(data voidptr, size int) Option {
if size > 255 { if size >= 500 {
panic('option size too big: $size (max is 255), this is a temporary limit') panic('option size too big: $size (max is 500), this is a temporary limit')
} }
res := Option { res := Option {
ok: true ok: true