Commit Graph

2323 Commits

Author SHA1 Message Date
Andrew Kelley
5911962842
Merge pull request #759 from zig-lang/error-sets
Error Sets
2018-02-09 00:47:57 -05:00
Andrew Kelley
8e554561df appveyor: answer Yes to all pacman questions 2018-02-09 00:47:13 -05:00
Andrew Kelley
32c988a2d7 fix build runner on windows 2018-02-09 00:24:23 -05:00
Andrew Kelley
916d24cd21 add compile error tests for error sets 2018-02-08 23:44:21 -05:00
Andrew Kelley
4b16874f04 add test for comptime err to int with only 1 member of set 2018-02-08 22:44:15 -05:00
Andrew Kelley
ee982ae162 syntax: parse ?error!i32 as ?(error!i32) 2018-02-08 22:30:08 -05:00
Andrew Kelley
0efe441dfd if statements support comptime known test error, runtime payload 2018-02-08 22:18:13 -05:00
Andrew Kelley
54c06bf715 error sets: runtime safety for int-to-err and err set cast 2018-02-08 21:54:44 -05:00
Andrew Kelley
8fc6e31567 std: fix return type of std.c.write 2018-02-08 20:46:12 -05:00
Andrew Kelley
f9be970375 Merge remote-tracking branch 'origin/master' into error-sets 2018-02-08 20:45:26 -05:00
Andrew Kelley
57edd4dcb3 error sets - fix bad value for constant error literal 2018-02-08 18:13:07 -05:00
Marc Tiehuis
1c236b0766 Add ArrayList functions (#755)
at - Get the item at the n-th index.

insert - Insert and item into the middle of the list, resizing and copying
existing elements if needed.

insertSlice - Insert a slice into the middle of the list, resizing and
copying existing elements if needed.
2018-02-08 11:22:31 -05:00
Andrew Kelley
fee875770c error set casting building 2018-02-08 11:09:18 -05:00
Andrew Kelley
76239f2089 error sets - update langref. all tests passing 2018-02-08 03:02:41 -05:00
Andrew Kelley
0d5ff6f462 error sets - most tests passing 2018-02-08 02:08:45 -05:00
Andrew Kelley
68238d5678 fix comptime fn execution not returning error unions properly 2018-02-07 22:33:05 -05:00
Ben Noordhuis
dd20f558f0 implement openSelfExe() on darwin (#753) 2018-02-07 18:14:32 -05:00
Jeff Fowler
c88e6e8aee improve behavior of zig build (#754)
See #748
2018-02-07 17:45:20 -05:00
Ben Noordhuis
79ad1d9610 format struct pointers as "<typename>@<address>" (#752) 2018-02-07 16:18:48 -05:00
Ben Noordhuis
0090c2d70b DRY 'is slice?' conditionals in parser (#750) 2018-02-07 14:38:49 -05:00
Andrew Kelley
f99b8b006f error sets - fix most std lib compile errors 2018-02-05 18:09:13 -05:00
Andrew Kelley
6940212ecb error sets: fix peer resolution of error unions 2018-02-05 17:42:13 -05:00
Andrew Kelley
917e6fe370 handle linux returning EINVAL for large writes
See #743
2018-02-05 13:21:08 -05:00
Andrew Kelley
40e4e42a66 handle linux returning EINVAL for large reads
see #743
2018-02-05 12:48:29 -05:00
Andrew Kelley
44d8d654a0 fix test failure, organize code, add new compile error 2018-02-05 09:26:39 -05:00
Andrew Kelley
ec59f76526
Merge pull request #743 from bnoordhuis/linux-random
Use /dev/urandom and sysctl(RANDOM_UUID) on Linux.
2018-02-05 08:09:10 -05:00
Andrew Kelley
b7bc259093 make OutStream and InStream take an error set param 2018-02-05 07:38:24 -05:00
Andrew Kelley
893f1088df error sets - peer resolution for error unions 2018-02-05 01:49:14 -05:00
Andrew Kelley
15075d2c3d error sets - compile error for equality with no common errors 2018-02-05 00:05:04 -05:00
Andrew Kelley
31abef172a fix accidentally linking against kernel32 on non windows 2018-02-04 22:13:21 -05:00
Andrew Kelley
21ce559c9c add --forbid-library
to help track down accidentally linking against a library
2018-02-04 22:06:03 -05:00
Ben Noordhuis
73ee434c8c Use /dev/urandom and sysctl(RANDOM_UUID) on Linux.
Add fallback paths for when the getrandom(2) system call is not
available.  Try /dev/urandom first and sysctl(RANDOM_UUID) second.

The sysctl issues a warning in the system logs with some kernels but
that seems like an acceptable tradeoff for the fallback of a fallback.
2018-02-04 18:58:36 +01:00
Andrew Kelley
61718742f7 *WIP* error sets - std lib test compile but try to link against windows 2018-02-03 14:42:20 -05:00
Andrew Kelley
ef5e7bb469 *WIP* error sets - an inferred error set can end up being the global one 2018-02-03 14:06:37 -05:00
Andrew Kelley
abf5ae6897 *WIP* error sets - support fns called at comptime 2018-02-03 11:51:29 -05:00
Andrew Kelley
b8f59e14cd *WIP* error sets - correctly resolve inferred error sets 2018-02-02 18:13:32 -05:00
Andrew Kelley
39d5f44863 *WI* error sets - basic support working 2018-02-02 14:26:14 -05:00
Andrew Kelley
cfb2c67692 *WIP* error sets - rewrite "const cast only" function 2018-02-02 11:50:19 -05:00
Andrew Kelley
15eb28efaf
Merge pull request #738 from corngood/cygwin-fixes
make lld include paths private
2018-02-02 10:53:54 -05:00
David McFarland
4ec856b0f0 make lld include paths private
This fixes a build failure on cygwin caused by <string.h> -> <strings.h> taking
the latter from one of the lld paths.
2018-02-02 10:49:31 -04:00
Andrew Kelley
406496ca33 *WIP* error sets - allow peer type resolution to create new error set 2018-02-01 23:32:09 -05:00
Andrew Kelley
13b36d458f *WIP* error sets - fix implicit cast 2018-02-01 10:23:25 -05:00
Andrew Kelley
5f518dbeb9 *WIP* error sets converting std lib 2018-01-31 22:48:40 -05:00
Andrew Kelley
02b61224b2 add docs for memberType, memberCount, memberName 2018-01-31 20:56:53 -05:00
Andrew Kelley
e6d4028a84 docs: move source encoding section 2018-01-31 20:42:27 -05:00
Andrew Kelley
3a11757d57 add docs recommending to only have 1 cImport 2018-01-31 20:18:47 -05:00
Andrew Kelley
a795e4ce32 add some docs for reflection 2018-01-31 11:47:56 -05:00
Andrew Kelley
44f38b04b0 fix assertion fail when using global var number literal
closes #697
2018-01-31 11:13:39 -05:00
Andrew Kelley
5161d70620 *WIP* error sets 2018-01-31 01:51:31 -05:00
Andrew Kelley
40ca39d3d5 fix error message mentioning unreachable instead of noreturn 2018-01-31 01:44:52 -05:00