aboutsummaryrefslogtreecommitdiff
path: root/test/cases/error.zig
AgeCommit message (Collapse)Author
2019-01-29backport copy elision changesAndrew Kelley
This commit contains everything from the copy-elision-2 branch that does not have to do with copy elision directly, but is generally useful for master branch. * All const values know their parents, when applicable, not just structs and unions. * Null pointers in const values are represented explicitly, rather than as a HardCodedAddr value of 0. * Rename "maybe" to "optional" in various code locations. * Separate DeclVarSrc and DeclVarGen * Separate PtrCastSrc and PtrCastGen * Separate CmpxchgSrc and CmpxchgGen * Represent optional error set as an integer, using the 0 value. In a const value, it uses nullptr. * Introduce type_has_one_possible_value and use it where applicable. * Fix debug builds not setting memory to 0xaa when storing undefined. * Separate the type of a variable from the const value of a variable. * Use copy_const_val where appropriate. * Rearrange structs to pack data more efficiently. * Move test/cases/* to test/behavior/* * Use `std.debug.assertOrPanic` in behavior tests instead of `std.debug.assert`. * Fix outdated slice syntax in docs.
2018-11-13New Zig formal grammar (#1685)Jimmi Holst Christensen
Reverted #1628 and changed the grammar+parser of the language to not allow certain expr where types are expected
2018-10-15Solve the return type ambiguity (#1628)Jimmi Holst Christensen
Changed container and initializer syntax * <container> { ... } -> <container> . { ... } * <exrp> { ... } -> <expr> . { ...}
2018-06-18remove error to/from int casting syntax; add `@errorToInt`/`@intToError`Andrew Kelley
See #1061
2018-06-18remove error set casting syntax. add `@errSetCast`Andrew Kelley
See #1061
2018-06-09breaking syntax change: ??x to x.? (#1095)Andrew Kelley
See #1023 This also renames Nullable/Maybe to Optional
2018-05-30run zig fmt on the codebaseAndrew Kelley
2018-05-29run zig fmt on the codebaseAndrew Kelley
See #1003
2018-04-30[breaking] delete ptr deref prefix opAndrew Kelley
start using zig-fmt-pointer-reform branch build of zig fmt to fix code to use the new syntax all of test/cases/* are processed, but there are more left to be done - all the std lib used by the behavior tests
2018-04-28Functions with infered error set can now return literalsJimmi Holst Christensen
fixes #852
2018-04-28Removed zero sized error set optimizationJimmi Holst Christensen
fixes #762 fixes #818
2018-02-09fix crash with error peer type resolutionAndrew Kelley
closes #765
2018-02-08add test for comptime err to int with only 1 member of setAndrew Kelley
2018-02-08syntax: parse `?error!i32` as `?(error!i32)`Andrew Kelley
2018-02-08if statements support comptime known test error, runtime payloadAndrew Kelley
2018-02-08error sets - fix bad value for constant error literalAndrew Kelley
2018-02-08error sets - most tests passingAndrew Kelley
2018-02-02*WI* error sets - basic support workingAndrew Kelley
2018-01-31*WIP* error sets converting std libAndrew Kelley
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-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
2017-12-22explicitly return from blocksAndrew Kelley
instead of last statement being expression value closes #629
2017-05-23clean up behavior test namesAndrew Kelley
2017-03-26new unreachable syntaxAndrew Kelley
* `noreturn` is the primitive type. * `unreachable` is a control flow keyword. * `@unreachable()` builtin function is deleted. closes #214
2017-03-16introduce new test syntaxAndrew Kelley
* remove setFnTest builtin * add test "name" { ... } syntax * remove --check-unused argument. functions are always lazy now.
2017-02-12slice and array re-work plus some misc. changesAndrew Kelley
* `@truncate` builtin allows casting to the same size integer. It also performs two's complement casting between signed and unsigned integers. * The idiomatic way to convert between bytes and numbers is now `mem.readInt` and `mem.writeInt` instead of an unsafe cast. It works at compile time, is safer, and looks cleaner. * Implicitly casting an array to a slice is allowed only if the slice is const. * Constant pointer values know if their memory is from a compile- time constant value or a compile-time variable. * Cast from [N]u8 to []T no longer allowed, but [N]u8 to []const T still allowed. * Fix inability to pass a mutable pointer to comptime variable at compile-time to a function and have the function modify the memory pointed to by the pointer. * Add the `comptime T: type` parameter back to mem.eql. Prevents accidentally creating instantiations for arrays.
2017-02-07std.io supports printing integers as hex valuesAndrew Kelley
remove "unnecessary if statement" error this "depends on compile variable" code is too hard to validate, and has false negatives. not worth it right now. std.str removed, instead use std.mem. std.mem.eql and std.mem.sliceEql merged and do not require explicit type argument.
2017-01-05self hosted tests import std libraryAndrew Kelley
2016-12-26IR testing: rename cases3 dir to casesAndrew Kelley