jckarter/clay — pull request #341 by stepancheg (2012-08-16 20:30:14+00:00)
Title: core.errors: StaticAssert(#cond)

StaticAssert is similar to C++11 static_assert.

Example of use:

```
transform(x) {
StaticAssert(Type(begin(x)) == Pointer[Char]);
...
}
```

Failing assertions produce output like this:

```
###############################
main() {
StaticAssert(#(TypeSize(Int8) == 9));
----------------^
}

###############################
core/errors/staticassert/neg/main.clay(2,16): error: no matching overload found
../lib-clay/core/errors/errors.clay(83,0)
pattern "#true" did not match type "Static[false]" of argument 1
60 universal overloads not shown (show with -full-match-errors option)

compilation context:
StaticAssert(Static[false])
core/errors/staticassert/neg/main.clay(2,16):
main()
../lib-clay/core/system/system.clay(22,30):
getExitCode()
../lib-clay/core/system/system.clay(22,26):
runMain(Int32, Pointer[Pointer[Int8]], Static[main])
../lib-clay/core/system/system.clay(32,13):
callMain(Static[main], Int32, Pointer[Pointer[Int8]])
external main
```