mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-28 01:21:40 +00:00
fixed a bug in map for sets
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
discard """
|
||||
output: '''true'''
|
||||
output: '''true
|
||||
true'''
|
||||
"""
|
||||
|
||||
import sets
|
||||
var
|
||||
a = initSet[int]()
|
||||
b = initSet[int]()
|
||||
c = initSet[string]()
|
||||
|
||||
for i in 0..5: a.incl(i)
|
||||
for i in 1..6: b.incl(i)
|
||||
for i in 0..5: c.incl($i)
|
||||
|
||||
echo map(a, proc(x: int): int = x + 1) == b
|
||||
echo map(a, proc(x: int): string = $x) == c
|
||||
|
||||
Reference in New Issue
Block a user