mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Complete transition to fn. Introduce global/threadlocal
This commit is contained in:
committed by
Christoffer Lerno
parent
e2621617f1
commit
b52b42d4da
@@ -1,11 +1,11 @@
|
||||
// #target: x64-windows
|
||||
|
||||
func int foo()
|
||||
fn int foo()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
func void test()
|
||||
fn void test()
|
||||
{
|
||||
int x = foo();
|
||||
int y = foo();
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
int x = 3;
|
||||
|
||||
func void test()
|
||||
fn void test()
|
||||
{
|
||||
$assert(x == 3); // #error: Compile time evaluation requires a compile time constant value.
|
||||
}
|
||||
|
||||
func void test2()
|
||||
fn void test2()
|
||||
{
|
||||
int i = 0;
|
||||
$assert(1);
|
||||
$assert(i == 0); // #error: Compile time evaluation requires a compile time constant value.
|
||||
}
|
||||
|
||||
func int foo();
|
||||
func void test3()
|
||||
fn int foo();
|
||||
fn void test3()
|
||||
{
|
||||
int i = 0;
|
||||
$assert(foo() == 0); // #error: Compile time evaluation requires a compile time constant value.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
const int FOO = 2;
|
||||
|
||||
func void test()
|
||||
fn void test()
|
||||
{
|
||||
$assert(FOO == 2, "Bad");
|
||||
$assert(FOO == 0, "Good"); // #error: Compile time assert - Good
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
|
||||
func int foo()
|
||||
fn int foo()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
func void test()
|
||||
fn void test()
|
||||
{
|
||||
int x = foo();
|
||||
if (x > 0) return;
|
||||
|
||||
Reference in New Issue
Block a user