You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Causes issue 70 (nim-lang/nimforum#70) in nim-lang/nimforum.
When you have a string as the result of an if statement in a template, the "roof" operator doesn't work correctly; based on following the stack trace it looks like it's trying to get openarray length and then crashes b/c the string is not an openarray / does not have sons.
Sample code
#test_roof_constexpr.nim# This crashes the compiler, but not if doTest is a proctemplatedoTest(a: string,c: int) =var b =if c mod2==0: a[^5..^1]
else: "SOME CONSTANT STRING"echo b
whenisMainModule:
doTest("THIS IS A TEST",5)
Very strange - I'm using the devel version of the compiler on amd64 linux.
singularperturbation@localhost ~/Nim> nim --version
Nim Compiler Version 0.12.1 (2015-11-13) [Linux: amd64]
Copyright (c) 2006-2015 by Andreas Rumpf
git hash: 0f7fdd8bf4d4f747f01c4d95ce64d96763286afc
active boot switches:
singularperturbation@localhost ~/Nim> uname -a
Linux localhost 3.10.18 #1 SMP Thu Oct 15 02:16:25 PDT 2015 x86_64 x86_64 x86_64 GNU/Linux
singularperturbation@localhost ~/Nim>
As of writing, I think this has the latest commit from nim-lang/Nim
Causes issue 70 (nim-lang/nimforum#70) in nim-lang/nimforum.
When you have a string as the result of an if statement in a template, the "roof" operator doesn't work correctly; based on following the stack trace it looks like it's trying to get openarray length and then crashes b/c the string is not an openarray / does not have sons.
Sample code
Compilation message
The text was updated successfully, but these errors were encountered: