v icon indicating copy to clipboard operation
v copied to clipboard

Multiple errors when initializing array of options

Open impopular-guy opened this issue 1 year ago • 1 comments

Describe the bug

  1.  a := [?int(none), 1]
     println(a)
    

    expected: [Option(error: none), Option(1)] current: [Option(error: none), Option(error: none)]

  2.  _ := [?int(none), none]
    

    expected: success current: builder error: cannot convert 'extern struct IError' to 'unsigned char'

  3.  a := []?int{len: 2, init: 1}
     println(a)
    

    expected: [Option(1), Option(1)] current: [Option(error: none), Option(error: none)]

  4.  a := []?int{len: 2, init: none}
     println(a)
    

    expected: [Option(error: none), Option(error: none)] current: builder error: cannot convert 'extern struct IError' to 'unsigned char'

Expected Behavior

see above

Current Behavior

see above

Reproduction Steps

see above

https://play.vlang.io/p/68682e3e14

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.3.3 2879afa

Environment details (OS name and version, etc.)

Playground

impopular-guy avatar Mar 08 '23 11:03 impopular-guy

Hello. The 3 and 4 points are already fixed in this week.

felipensp avatar Mar 08 '23 12:03 felipensp