diff options
author | LemonBoy <LemonBoy@users.noreply.github.com> | 2018-06-30 13:43:55 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-06-30 13:43:55 +0200 |
commit | eec239e851c6be4922d9746d07a20c37c0157442 (patch) | |
tree | 133325ad0b862035a44aaab30752d5f3d0571297 /tests/concepts | |
parent | 7ae9c4358e9385bbcce0b1acd874e3e2a51a1613 (diff) | |
download | Nim-eec239e851c6be4922d9746d07a20c37c0157442.tar.gz |
Fix constant folding of len() with concept type (#8143)
Fixes #7952
Diffstat (limited to 'tests/concepts')
-rw-r--r-- | tests/concepts/t7952.nim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/concepts/t7952.nim b/tests/concepts/t7952.nim new file mode 100644 index 000000000..96ff47e4a --- /dev/null +++ b/tests/concepts/t7952.nim @@ -0,0 +1,12 @@ +discard """ + output: 5 +""" + +type + HasLen = concept iter + len(iter) is int + +proc echoLen(x: HasLen) = + echo len(x) + +echoLen([1, 2, 3, 4, 5]) |