Files
Nim/lib/pure
Dan Rose c579243e0c Pass check condition directly to if (#20217)
When checking conditions, pass `check` untyped argument directly to if. This results in better error messages when the condition is malformed.

Previously `check 1` would fail at compile time with `Error: type mismatch: got 'int literal(-2)' for '-2' but expected 'bool'`
Now it fails with `Error: type mismatch: got 'int literal(1)' for '1' but expected 'bool'`.

Similarly `check "foo"` would fail with
```
Error: type mismatch: got <string>
but expected one of:
proc `not`(a: typedesc): typedesc
  first type mismatch at position: 1
  required type for a: typedesc
  but expression '"somestring"' is of type: string
...
```
Now it fails with `Error: type mismatch: got 'string' for '"somestring"' but expected 'bool'`
2022-08-15 18:37:10 -04:00
..
2021-08-31 08:14:05 +02:00
2021-12-20 10:40:32 +01:00
2022-06-04 07:03:03 +02:00
2015-10-01 12:05:45 -07:00
2021-02-23 21:05:39 -08:00
2021-07-13 09:22:33 +02:00
2021-04-08 14:08:58 +02:00
2018-04-06 11:59:49 +02:00
2022-02-02 17:10:11 +01:00
2021-01-09 00:24:41 +01:00
2022-02-02 17:10:11 +01:00
2022-02-14 22:15:59 +00:00
2022-02-02 17:10:11 +01:00
2021-04-06 22:08:59 +02:00
2022-07-18 14:20:30 +08:00
2021-02-24 21:47:27 -08:00
2022-02-02 17:10:11 +01:00
2022-02-02 17:10:11 +01:00
2021-02-21 00:27:39 -08:00
2022-08-02 00:06:27 +08:00
2022-02-02 17:10:11 +01:00
2021-07-20 12:50:43 +02:00
2021-08-23 00:13:39 +02:00
2021-10-05 12:29:59 +02:00
2021-09-19 23:35:50 +02:00
2021-02-08 09:46:07 +01:00
2022-02-02 17:10:11 +01:00