Andrew Kelley
e36680d3bd
fix detection of unable to evaluate constant expression
2019-06-19 15:18:51 -04:00
Andrew Kelley
b588a803bf
fix comptime modification of const struct field
2019-06-19 14:35:59 -04:00
Andrew Kelley
79671efd3a
fix inline loop behavior with variable result loc
2019-06-18 17:43:05 -04:00
Andrew Kelley
e27da17ff2
back to many behavioral tests passing
2019-06-18 17:07:27 -04:00
Andrew Kelley
9564c05cd5
better result location handling of inline loops
2019-06-15 19:19:13 -04:00
Andrew Kelley
6bf193af19
better result location semantics with optionals and return locations
...
somewhere along this branch, #1901 has been fixed.
2019-06-15 12:28:21 -04:00
Andrew Kelley
acf16b5fb3
uncomment more passing tests
2019-06-14 13:32:04 -04:00
Andrew Kelley
7c074b8516
fix peer result locs with switch
2019-06-14 11:41:53 -04:00
Andrew Kelley
2ba29a1907
fix peer result location with error code and payload
2019-06-14 11:01:38 -04:00
Andrew Kelley
fdaca1b5f3
fix a couple more test regressions
2019-06-13 20:30:39 -04:00
Andrew Kelley
eaf74f4f96
fix bitcast packed struct to integer and back
2019-06-13 20:24:10 -04:00
Andrew Kelley
57347aacd7
fix atomic builtin functions
2019-06-13 20:01:25 -04:00
Andrew Kelley
24cfa3534f
allow comptime array literals casted to slices
2019-06-13 16:51:26 -04:00
Andrew Kelley
3cbe827464
fix behavior for nested array literals
...
new compile error for trying to cast runtime array literals to slices
2019-06-13 16:25:35 -04:00
Andrew Kelley
efb064449f
fix runtime initialize array elem and then implicit cast to slice
2019-06-13 13:31:15 -04:00
Andrew Kelley
ca0988e1d0
comment out the behavior tests that are failing
2019-06-12 22:19:56 -04:00
Andrew Kelley
b735764898
different array literal syntax when inferring the size
...
old syntax: []i32{1, 2, 3}
new syntax: [_]i32{1, 2, 3}
closes #1797
2019-06-09 19:26:32 -04:00
Andrew Kelley
78f32259da
default struct field initialization expressions
...
closes #485
2019-05-30 15:46:11 -04:00
tgschultz
f9e7bd2682
std.meta/trait: def/definition => decl/declaration
...
TypeInfo: defs/Definition => decls/Declarations
2019-05-29 20:43:07 -04:00
Andrew Kelley
bfc86776d5
run zig fmt to update use to usingnamespace
2019-05-29 19:09:58 -04:00
Andrew Kelley
9891c4f30d
Merge branch 'use-struct-pt2' of https://github.com/LemonBoy/zig into LemonBoy-use-struct-pt2
2019-05-29 15:48:49 -04:00
Andrew Kelley
b66438eb80
no "use of undeclared identifer" in dead comptime branches
2019-05-28 18:19:27 -04:00
Andrew Kelley
9d16839420
fix invalid LLVM IR generated for ?*void const casts
...
closes #2578
2019-05-28 16:11:36 -04:00
Andrew Kelley
2b42e910bf
behavior tests passing on Linux
2019-05-26 19:56:37 -04:00
Andrew Kelley
df7aa9a4f0
allow implicit optional pointer to optional c_void pointer
2019-05-26 17:55:20 -04:00
Andrew Kelley
269a53b6af
introduce @hasDecl builtin function
...
closes #1439
2019-05-26 16:21:03 -04:00
Andrew Kelley
21ed939117
support enum literals implicit casting to tagged unions
2019-05-26 12:59:30 -04:00
LemonBoy
f67ca20655
Make use work with arbitrary structs
2019-05-21 17:07:40 +02:00
LemonBoy
6672ee9eb3
Fix too eager comptime evaluation of error ptr
2019-05-19 15:53:32 -04:00
LemonBoy
b660134a18
Use the correct scope for use
...
use expressions outside the top-level scope now work as intended.
2019-05-19 00:32:49 -04:00
Andrew Kelley
860684cc2f
Merge pull request #2516 from LemonBoy/32bfix
...
More 32bit fixes for stdlib
2019-05-19 00:31:16 -04:00
LemonBoy
0a3aec020a
Fix load/store of non-integer fields in packed struct
2019-05-18 19:59:47 -04:00
LemonBoy
6957927194
Fix some test cases to run on 32bit systems
2019-05-18 10:59:56 +02:00
Andrew Kelley
80983ca1ca
fixups to the previous commit
2019-05-16 16:37:58 -04:00
Shawn Landden
1fdb24827f
breaking changes to all bit manipulation intrinsics
...
* `@clz`, `@ctz`, `@popCount`, `@bswap`, `@bitreverse` now
have a type parameter
* rename @bitreverse to @bitReverse
* rename @bswap to @byteSwap
Closes #2119
Closes #2120
2019-05-16 16:37:58 -04:00
Andrew Kelley
057a5d4898
slice types no longer have field access
...
* fix crash when doing field access of slice types. closes #2486
* remove the deprecated Child property from slice types
* add -Dskip-non-native build option to build script
2019-05-14 21:21:59 -04:00
Andrew Kelley
e93a05b6e4
switching on error sets makes new error set for capture values
...
closes #769
2019-05-14 19:11:37 -04:00
Andrew Kelley
df4f77024e
else value when switching on error set has
...
optional capture value which is subset.
see #769
2019-05-14 18:06:57 -04:00
LemonBoy
b05e8d46ec
Change the enum value allocation strategy
2019-05-11 21:29:53 +02:00
LemonBoy
c766f3f9ca
Support signed types as enum tags
2019-05-11 21:28:58 +02:00
Jimmi Holst Christensen
6cf7fb1177
fixes #2235
2019-05-11 20:51:59 +02:00
Jimmi Holst Christensen
fb3b943b07
added tests for global variable declaration syntax
2019-05-11 20:11:56 +02:00
Andrew Kelley
a4aee8b24d
C pointers support if and orelse
...
See #1967
2019-05-08 18:47:14 -04:00
Andrew Kelley
0099583bd3
C pointers support .? operator
...
see #1967
2019-05-08 17:39:00 -04:00
Andrew Kelley
50bbb34594
C pointers support null
...
See #1967
2019-05-08 16:06:34 -04:00
Andrew Kelley
9dfd24a334
add test case to cover solved bug
...
closes #2114
2019-04-30 14:17:16 -04:00
LemonBoy
9902b604cb
Fix generation of container initializers
...
The code creates temporary ConstExprValue with global_refs set to
nullptr and that's carried over to the final value. Doing so prevents
the deduplication mechanism to work correctly, causing all sorts of
runtime crashes.
Fixes #1636
Fixes #1608 (Even though it was already fixed by #1991 )
2019-04-28 13:13:42 -04:00
LemonBoy
9ec4ccc68f
Do not invoke UB in BigInt shr operations
...
Shifting a value of type T by an amount that's greater or equal to the
size of the type itself is UB.
Spotted by @tgschultz
2019-04-26 14:24:35 -04:00
Andrew Kelley
fb2acaff06
@sizeOf returns 0 for comptime types
...
This defines `@sizeOf` to be the runtime size of a type, which means
that it is zero for types such as comptime_int, type, and (enum
literal).
See #2209
2019-04-24 22:31:53 -04:00
Jimmi HC
1a2e02e267
fixed #2356
...
const_ptr_pointee_unchecked did not take into account that if the
pointer is zero sized, then const_val->data.x_ptr.special would be
ConstPtrSpecialInvalid. This commit fixes this by also checking
that the child type of the pointer only have one possible value
and just returns that value.
2019-04-24 15:04:58 +02:00