mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Change distinct -> typedef.
- Order of attribute declaration is changed for `alias`. - Added `LANGUAGE_DEV_VERSION` env constant. - Rename `anyfault` -> `fault`. - Changed `fault` -> `faultdef`. - Added `attrdef` instead of `alias` for attribute aliases.
This commit is contained in:
committed by
Christoffer Lerno
parent
fc5615a7a1
commit
5c77c9a754
@@ -1,17 +1,17 @@
|
||||
module math_tests @test;
|
||||
import math_tests::complex;
|
||||
|
||||
alias ComplexDouble = ComplexType{double} @local;
|
||||
alias ComplexInt = ComplexType{int} @local;
|
||||
alias ComplexDouble @local = ComplexType {double};
|
||||
alias ComplexInt @local = ComplexType {int};
|
||||
|
||||
module math_tests::complex{ElementType} @test;
|
||||
module math_tests::complex {ElementType} @test;
|
||||
import std::math;
|
||||
|
||||
alias ComplexType = Complex{ElementType};
|
||||
alias ComplexType = Complex {ElementType};
|
||||
|
||||
fn void complex_mul_imaginary()
|
||||
{
|
||||
ComplexType i = complex::IMAGINARY{ElementType};
|
||||
ComplexType i = complex::IMAGINARY {ElementType};
|
||||
assert(i.mul(i).equals((ComplexType){-1, 0}));
|
||||
assert(i.mul(i).mul(i).equals((ComplexType){0, -1}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user