fixes #836
This commit is contained in:
parent
32ec5af60a
commit
abb2c21047
2 changed files with 20 additions and 0 deletions
17
tests/generics/tcannot_pass_empty_seq_to_generic.nim
Normal file
17
tests/generics/tcannot_pass_empty_seq_to_generic.nim
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
discard """
|
||||
errormsg: "type mismatch: got (seq[empty])"
|
||||
line: 16
|
||||
"""
|
||||
|
||||
# bug #836
|
||||
|
||||
type
|
||||
TOption*[T] = object
|
||||
case FIsSome: bool
|
||||
of false: nil
|
||||
of true: FData: T
|
||||
|
||||
proc some*[T](value: T): TOption[T] = TOption[T](FIsSome: true, FData: value)
|
||||
|
||||
echo some(@[]).FIsSome
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue