- 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:
Christoffer Lerno
2025-03-15 15:21:55 +01:00
committed by Christoffer Lerno
parent fc5615a7a1
commit 5c77c9a754
221 changed files with 649 additions and 684 deletions

View File

@@ -100,7 +100,7 @@ after_check3: ; preds = %loop.cond
br label %noerr_block
panic_block: ; preds = %assign_optional
%4 = insertvalue %any undef, ptr %error_var, 0
%5 = insertvalue %any %4, i64 ptrtoint (ptr @"$ct.anyfault" to i64), 1
%5 = insertvalue %any %4, i64 ptrtoint (ptr @"$ct.fault" to i64), 1
store %any %5, ptr %varargslots, align 16
%6 = insertvalue %"any[]" undef, ptr %varargslots, 0
%"$$temp" = insertvalue %"any[]" %6, i64 1, 1

View File

@@ -4,7 +4,7 @@ fn void test1()
foreach (a : x) { }; // #error: It's not possible to enumerate an expression of type 'int'
}
distinct Test1 = int;
typedef Test1 = int;
fn void test2()
{

View File

@@ -1,7 +1,7 @@
// #target: macos-x64
module test;
import std;
distinct TypeA = char[];
typedef TypeA = char[];
fn char TypeA.get(self, usz i) @operator([]) {
return ((char[])self)[i];

View File

@@ -1,4 +1,4 @@
distinct Type = char*;
typedef Type = char*;
fn usz Type.len(str)
{
return 0;

View File

@@ -4,7 +4,7 @@ fn void test1()
foreach_r (a : x) { }; // #error: It's not possible to enumerate an expression of type 'int'
}
distinct Test1 = int;
typedef Test1 = int;
fn void test2()
{

View File

@@ -2,7 +2,7 @@
module foo;
import std::io;
fault ABC;
faultdef ABC;
fn void? test()
{

View File

@@ -135,7 +135,7 @@ fn void test_missing_no_cases(Baz x)
}
}
fault DIVISION_BY_ZERO;
faultdef DIVISION_BY_ZERO;
// Rethrowing an error uses "!!" suffix
fn void? testMayError()

View File

@@ -3,8 +3,8 @@ module mymodule;
extern fn void printf(char *, ...);
fault FOO;
fault BAR, BAZ;
faultdef FOO;
faultdef BAR, BAZ;
fn void test()
{