Andrew Kelley
13b5a4bf8c
remove cancel
2019-08-15 14:05:12 -04:00
Andrew Kelley
f3f838cc01
add compile error for await in exported function
2019-08-14 11:22:12 -04:00
Andrew Kelley
8a9289996a
Merge remote-tracking branch 'origin/master' into rewrite-coroutines
2019-08-13 11:39:32 -04:00
Andrew Kelley
4d8d513e16
all tests passing
2019-08-11 19:53:10 -04:00
Andrew Kelley
1b83ee78a4
allow comptime_int to implicit cast to comptime_float
2019-08-11 12:01:02 -04:00
Andrew Kelley
bfa1d12fba
better compile errors when frame depends on itself
2019-08-08 13:44:57 -04:00
Andrew Kelley
87710a1cc2
implement @asyncCall
which supports async function pointers
2019-08-03 16:17:42 -04:00
Andrew Kelley
c879209661
add compile error for calling async function pointer
2019-08-03 02:40:38 -04:00
Andrew Kelley
24d78177ee
add compile error for async call of function pointer
2019-08-03 01:06:14 -04:00
Andrew Kelley
b3b6a98451
Merge remote-tracking branch 'origin/master' into rewrite-coroutines
2019-08-02 16:31:43 -04:00
Andrew Kelley
d105769926
fix regressions regarding writing through const pointers
2019-08-02 16:09:40 -04:00
Andrew Kelley
19ee495750
add error for function with ccc indirectly calling async function
2019-07-23 19:35:41 -04:00
Andrew Kelley
af8661405b
fix usingnamespace
...
It used to be that usingnamespace was only allowed at top level. This
made it OK to put the state inside the AST node data structure. However,
now usingnamespace can occur inside any aggregate data structure, and
therefore the state must be in the TopLevelDeclaration rather than in
the AST node.
There were two other problems with the usingnamespace implementation:
* It was passing the wrong destination ScopeDecl, so it could cause an
incorrect error such as "import of file outside package path".
* When doing `usingnamespace` on a file that already had
`pub usingnamespace` in it would "steal" the usingnamespace, causing
incorrect "use of undeclared identifier" errors in the target file.
closes #2632
closes #2580
2019-07-19 16:56:44 -04:00
Andrew Kelley
741c74e427
cleanups
2019-07-16 11:50:00 -04:00
Andrew Kelley
45cc488cef
Merge branch 'main-return-!u8' of https://github.com/SamTebbs33/zig into SamTebbs33-main-return
2019-07-16 11:27:11 -04:00
hryx
6bfa8546bb
Unicode escapes: stage1 tokenizer and behavior tests
2019-07-04 22:40:19 -07:00
SamTebbs33
f24b8f2a4a
Support returning !u8 from main
2019-07-04 14:26:05 +01:00
Andrew Kelley
96fd103073
improve the error message and test coverage
2019-07-04 00:35:28 -04:00
Andrew Kelley
bfe0bf695b
Merge branch 'impl-1107' of https://github.com/emekoi/zig into emekoi-impl-1107
2019-07-03 23:40:47 -04:00
emekoi
a1b952f4b0
added tests for #1107 and a note in the reference
2019-07-03 13:12:14 -05:00
Andrew Kelley
9daf0140e5
add missing compile error for comptime continue inside runtime catch
...
See #2604
2019-07-02 21:14:42 -04:00
Andrew Kelley
df11512f85
fixups
2019-07-02 16:52:55 -04:00
Andrew Kelley
1ccf6a2c9e
compile error for using slice as array init expr type
...
when there are more than 0 elements.
closes #2764
2019-06-27 12:24:13 -04:00
Andrew Kelley
fd4c5f54f0
all compile error tests passing
2019-06-25 19:03:56 -04:00
Andrew Kelley
0a77325916
fix several compile error test regressions
2019-06-25 18:06:03 -04:00
Andrew Kelley
42ea2d0d1c
fix @export
for arrays and allow sections on extern variables
...
previously `@export` for an array would panic with a TODO message.
now it will do the export. However, it uses the variable's name
rather than the name passed to `@export`. Issue #2679 remains open
for that problem.
2019-06-14 15:28:52 -04:00
SamTebbs33
6c160b8856
Add check for null body in if, for and while
2019-06-10 00:41:33 -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
Andrew Kelley
1ccbd1fb67
use
works on unions and enums in addition to structs
2019-05-29 16:31:49 -04:00
Andrew Kelley
b66438eb80
no "use of undeclared identifer" in dead comptime branches
2019-05-28 18:19:27 -04:00
LemonBoy
528c151a55
Reject undefined as type
...
Make analyze_type_expr behave like ir_resolve_type when the user tries
to use `undefined` as a type.
Closes #2436
2019-05-28 18:02:57 -04:00
Andrew Kelley
269a53b6af
introduce @hasDecl builtin function
...
closes #1439
2019-05-26 16:21:03 -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
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
Andrew Kelley
2933d6b848
add test case for previous commit
...
closes #2467
2019-05-10 16:57:37 -04:00
Michael Dusan
d065f297ab
stage1: compile error for loop expr val ignored
...
closes #2460
2019-05-10 10:05:40 -04:00
Jimmi HC
6b10f03b4a
Fixes and simplifications for stage 1 parser
2019-05-10 16:09:58 +02:00
Andrew Kelley
c459edac18
compile error for attempt to cast enum literal to error
...
closes #2203
2019-05-09 13:18:13 -04:00
Andrew Kelley
50bbb34594
C pointers support null
...
See #1967
2019-05-08 16:06:34 -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
kristopher tate
fae0c35195
test/compile_errors.zig: add regression test for ziglang/zig#532 ;
2019-04-07 10:37:43 +09:00
emekoi
4a64f26627
added error for implicit cast from *const T to *[1]T. credit: @kristate
2019-03-31 16:47:34 -05:00
Shawn Landden
66f13ba807
stage1: better error message when comparing against null
...
Closes : #2104
2019-03-28 15:54:44 -04:00
Andrew Kelley
5eaead6a56
implement allowzero pointer attribute
...
closes #1953
only needed for freestanding targets.
also adds safety for `@intToPtr` when the address is zero.
2019-03-25 12:55:45 -04:00
Andrew Kelley
3306e43984
add compile error test for invalid enum literal implicit cast
...
See #683
2019-03-24 18:51:24 -04:00
Andrew Kelley
aff7b38838
make switch expressions allow enum literal types
...
See #683
2019-03-24 01:15:21 -04:00
Andrew Kelley
64dddd7afe
add compile error for ignoring error
...
closes #772
2019-03-23 19:33:00 -04:00