1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
  nix-repl> 1 + 1
  2

  nix-repl> :doc builtins.add
  Synopsis: builtins.add e1 e2

      Return the sum of the numbers e1 and e2.


  nix-repl> f = a: "" + a

Expect the trace to not contain any traceback:

  nix-repl> f 2
  error:
         … while concatenating
           at «string»:1:11:
              1| f = a: "" + a
               |           ^

         error: cannot coerce an integer to a string: 2

  nix-repl> :te
  showing error traces

Expect the trace to have traceback:

  nix-repl> f 2
  error:
         … from call site
           at «string»:1:1:
              1| f 2
               | ^

         … while calling anonymous lambda
           at «string»:1:5:
              1| f = a: "" + a
               |     ^

         … while concatenating
           at «string»:1:11:
              1| f = a: "" + a
               |           ^

         error: cannot coerce an integer to a string: 2

Turning it off should also work:

  nix-repl> :te
  not showing error traces

  nix-repl> f 2
  error:
         … while concatenating
           at «string»:1:11:
              1| f = a: "" + a
               |           ^

         error: cannot coerce an integer to a string: 2