summary refs log tree commit diff stats
path: root/tests/errmsgs/treportunused.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errmsgs/treportunused.nim')
-rw-r--r--tests/errmsgs/treportunused.nim14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/errmsgs/treportunused.nim b/tests/errmsgs/treportunused.nim
index f9b7c3d11..3105b35ea 100644
--- a/tests/errmsgs/treportunused.nim
+++ b/tests/errmsgs/treportunused.nim
@@ -13,12 +13,12 @@ treportunused.nim(30, 5) Hint: 's8' is declared but not used [XDeclaredButNotUse
 treportunused.nim(31, 5) Hint: 's9' is declared but not used [XDeclaredButNotUsed]
 treportunused.nim(32, 6) Hint: 's10' is declared but not used [XDeclaredButNotUsed]
 treportunused.nim(33, 6) Hint: 's11' is declared but not used [XDeclaredButNotUsed]
+treportunused.nim(37, 3) Hint: 'v0.99' is declared but not used [XDeclaredButNotUsed]
+treportunused.nim(38, 3) Hint: 'v0.99.99' is declared but not used [XDeclaredButNotUsed]
 '''
 action: compile
 """
 
-#treportunused.nim(37, 3) Hint: 'v0.99' is declared but not used [XDeclaredButNotUsed]
-#treportunused.nim(38, 3) Hint: 'v0.99.99' is declared but not used [XDeclaredButNotUsed]
 # bug #9764
 iterator s1(a:string): int = discard
 iterator s2(): int = discard
@@ -32,9 +32,7 @@ var s9: int
 type s10 = object
 type s11 = type(1.2)
 
-when false:
-  # enabled again when Nim bootstraps with -d:nimFpRoundtrips
-  # https://github.com/nim-lang/Nim/issues/14407
-  let
-    `v0.99` = "0.99"
-    `v0.99.99` = "0.99.99"
+# bug #14407 (requires `compiler/nim.cfg` containing define:nimFpRoundtrips)
+let
+  `v0.99` = "0.99"
+  `v0.99.99` = "0.99.99"
ix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
discard """
  output: '''Hello
Hello'''
"""

# bug #2581

const someVars = [ "Hello" ]
var someVars2 = [ "Hello" ]

proc getSomeVar: string =
    for i in someVars:
        if i == "Hello":
            result = i
            break

proc getSomeVar2: string =
    for i in someVars2:
        if i == "Hello":
            result = i
            break

echo getSomeVar()
echo getSomeVar2()