aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
AgeCommit message (Collapse)Author
2018-03-06ptrCast builtin now gives an error for removing const qualifierAndrew Kelley
closes #384
2018-02-28fix assert on self-referencing function ptr fieldBen Noordhuis
The construct `struct S { f: fn(S) void }` is not legal because structs are not copyable but it should not result in an ICE. Fixes #795.
2018-02-16ability to slice an undefined pointer at compile time if the len is 0Andrew Kelley
2018-02-14fix sometimes not type checking function parametersAndrew Kelley
closes #774 regression introduced in cfb2c676925d77887e46631dcafa783e6c65e61d
2018-02-09fix compiler crash switching on global error with no elseAndrew Kelley
2018-02-08add compile error tests for error setsAndrew Kelley
2018-02-08error sets: runtime safety for int-to-err and err set castAndrew Kelley
2018-02-08Merge remote-tracking branch 'origin/master' into error-setsAndrew Kelley
2018-02-08error sets - most tests passingAndrew Kelley
2018-02-05fix test failure, organize code, add new compile errorAndrew Kelley
2018-01-31*WIP* error sets converting std libAndrew Kelley
2018-01-31fix assertion fail when using global var number literalAndrew Kelley
closes #697
2018-01-31fix error message mentioning unreachable instead of noreturnAndrew Kelley
2018-01-30add compile error for duplicate struct, enum, union fieldsAndrew Kelley
closes #730
2018-01-29add compile error for calling naked functionAndrew Kelley
2018-01-29allow packed containers in extern functionsAndrew Kelley
2018-01-26fix compiler crash on function with invalid return typeAndrew Kelley
closes #722
2018-01-25syntax: functions require return type. remove `->`Andrew Kelley
The purpose of this is: * Only one way to do things * Changing a function with void return type to return a possible error becomes a 1 character change, subtly encouraging people to use errors. See #632 Here are some imperfect sed commands for performing this update: remove arrow: ``` sed -i 's/\(\bfn\b.*\)-> /\1/g' $(find . -name "*.zig") ``` add void: ``` sed -i 's/\(\bfn\b.*\))\s*{/\1) void {/g' $(find ../ -name "*.zig") ``` Some cleanup may be necessary, but this should do the bulk of the work.
2018-01-25rename "debug safety" to "runtime safety"Andrew Kelley
closes #437
2018-01-22add new kind of test: generating .h files. and moreAndrew Kelley
* docgen supports obj_err code kind for demonstrating errors without explicit test cases * add documentation for `extern enum`. See #367 * remove coldcc keyword and add @setIsCold. See #661 * add compile errors for non-extern struct, enum, unions in function signatures * add .h file generation for extern struct, enum, unions
2018-01-21fix crash when switching on enum with 1 field and no switch prongsAndrew Kelley
closes #712
2018-01-19all doc code examples are now testedAndrew Kelley
improve color scheme of docs make docs depend on no external files fix broken example code in docs closes #465
2018-01-18add compile error for shifting by negative comptime integerAndrew Kelley
closes #698
2018-01-18emit a compile error for @panic called at compile timeAndrew Kelley
closes #706
2018-01-15clean up error return tracingAndrew Kelley
* error return tracing is disabled in release-fast mode * add @errorReturnTrace * zig build API changes build return type from `void` to `%void` * allow `void`, `noreturn`, and `u8` from main. closes #535
2018-01-09remove %% prefix operatorAndrew Kelley
See #632 closes #545 closes #510 this makes #651 higher priority
2018-01-07replace `a %% b` with `a catch b`Andrew Kelley
See #632 better fits the convention of using keywords for control flow
2018-01-07replace `%return` with `try`Andrew Kelley
See #632 better fits the convention of using keywords for control flow
2018-01-07fix struct inside function referencing local constAndrew Kelley
closes #672 the crash and compile errors are fixed but structs inside functions still get named after the functions they're in. this will be fixed later.
2017-12-22explicitly return from blocksAndrew Kelley
instead of last statement being expression value closes #629
2017-12-20add labeled loops, labeled break, labeled continue. remove gotoAndrew Kelley
closes #346 closes #630 regression: translate-c can no longer translate switch statements. after #629 we can ressurect and modify the code to utilize arbitrarily returning from blocks.
2017-12-19fix assert when wrapping zero bit type in nullableAndrew Kelley
closes #659
2017-12-19bring back code that uses export and fix testsAndrew Kelley
partial revert of 1fdebc1dc4881a00766f7c2b4b2d8ee6ad6e79b6
2017-12-18wip export rewriteAndrew Kelley
2017-12-05add implicit cast from enum to unionAndrew Kelley
when the enum is the tag type of the union and is comptime known to be of a void field of the union See #642
2017-12-05fix casting integer literal to enumAndrew Kelley
2017-12-04more tests for unionsAndrew Kelley
See #618
2017-12-04fix abi alignment of union-enums not counting tag typeAndrew Kelley
add more tests for unions See #618
2017-12-03rework enums and unions and their relationship to each otherAndrew Kelley
* @enumTagName renamed to @tagName and it works on enums and union-enums * Remove the EnumTag type. Now there is only enum and union, and the tag type of a union is always an enum. * unions support specifying the tag enum type, and they support inferring an enum tag type. * Enums no longer support field types but they do support setting the tag values. Likewise union-enums when inferring an enum tag type support setting the tag values. * It is now an error for enums and unions to have 0 fields. * switch statements support union-enums closes #618
2017-12-02ability to set tag values of enumsAndrew Kelley
also remove support for enums with 0 values closes #305
2017-12-02casting between integer and enum only works via tag typeAndrew Kelley
See #305
2017-11-30ability to specify tag type of enumsAndrew Kelley
see #305
2017-11-25fix crash when constant inside comptime function has compile errorAndrew Kelley
closes #625
2017-11-15basic union supportAndrew Kelley
See #144
2017-11-09fix parameter of extern var args not type checkedAndrew Kelley
closes #601
2017-11-06add @memberType and @memberName builtin functionsAndrew Kelley
see #383 there is a plan to unify most of the reflection into 2 builtin functions, as outlined in the above issue, but this gives us needed features for now, and we can iterate on the design in future commits
2017-11-04add compile-time reflection for function arg typesAndrew Kelley
See #383
2017-10-26Improve invalid character error messages (#566)Marc Tiehuis
See #544
2017-10-25fix crash on field access of opaque typeAndrew Kelley
2017-10-23add maximum value for @setAlignStackAndrew Kelley