mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Rename def to alias.
This commit is contained in:
@@ -3,7 +3,7 @@ module test;
|
||||
import std::io;
|
||||
import std::collections::enumset;
|
||||
|
||||
def AbcEnumSet = EnumSet{Abc};
|
||||
alias AbcEnumSet = EnumSet{Abc};
|
||||
|
||||
enum Abc
|
||||
{
|
||||
|
||||
@@ -9,4 +9,4 @@ fn void abc()
|
||||
module tester;
|
||||
import foo;
|
||||
|
||||
def abc_my = foo::abc{int};
|
||||
alias abc_my = foo::abc{int};
|
||||
@@ -2,7 +2,7 @@
|
||||
module test;
|
||||
import bar;
|
||||
|
||||
def BazTest = Baz{Test}; // #error: Recursive definition of 'BazTest'
|
||||
alias BazTest = Baz{Test}; // #error: Recursive definition of 'BazTest'
|
||||
|
||||
struct Test
|
||||
{
|
||||
|
||||
@@ -14,8 +14,8 @@ fn Type addMult(Type x, Type a, Type b)
|
||||
module test;
|
||||
import gen;
|
||||
|
||||
def intMult = gen::mult{int};
|
||||
def doubleAddMult = gen::addMult{double};
|
||||
alias intMult = gen::mult{int};
|
||||
alias doubleAddMult = gen::addMult{double};
|
||||
|
||||
fn int getIt(int i)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ module abc{Type};
|
||||
import std::io;
|
||||
import std::collections::list;
|
||||
|
||||
def TextTagList = List{TextTag};
|
||||
alias TextTagList = List{TextTag};
|
||||
|
||||
fault UNTERMINATED_TAG, EMPTY_TAG, MISSING_TAG, UNSUPPORTED_TAG;
|
||||
|
||||
@@ -127,7 +127,7 @@ module text_test;
|
||||
import abc;
|
||||
import std::io;
|
||||
|
||||
def Tmpl = TextTemplate{Data};
|
||||
alias Tmpl = TextTemplate{Data};
|
||||
|
||||
struct Data
|
||||
{
|
||||
@@ -138,8 +138,8 @@ struct Data
|
||||
|
||||
|
||||
|
||||
def FooTmpl = TextTemplate{Foo};
|
||||
def BarTmpl = TextTemplate{Bar};
|
||||
alias FooTmpl = TextTemplate{Foo};
|
||||
alias BarTmpl = TextTemplate{Bar};
|
||||
|
||||
struct Foo
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ module testing;
|
||||
import std::io;
|
||||
import foo;
|
||||
|
||||
def Foo = foo::Foo;
|
||||
alias Foo = foo::Foo;
|
||||
|
||||
fn void main()
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ fn Type x(Type t)
|
||||
|
||||
module test;
|
||||
import hello;
|
||||
def xint = hello::x{int, -123};
|
||||
alias xint = hello::x{int, -123};
|
||||
|
||||
import std::io;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module test;
|
||||
import std;
|
||||
def ListStr = List{String};
|
||||
alias ListStr = List{String};
|
||||
fn void test()
|
||||
{
|
||||
List<String> a = List<...>.new_init(); // #error: An expression was expected
|
||||
|
||||
@@ -3,7 +3,7 @@ module test;
|
||||
import std::io;
|
||||
import std::collections::list;
|
||||
|
||||
def TreeNodeList = List{TreeNode};
|
||||
alias TreeNodeList = List{TreeNode};
|
||||
|
||||
struct TreeNode
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ macro void print_it(...)
|
||||
module playground;
|
||||
import playground::bug;
|
||||
|
||||
def MyFoo = Foo{int};
|
||||
alias MyFoo = Foo{int};
|
||||
|
||||
fn void main(String[] args)
|
||||
{
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// #target: macos-x64
|
||||
module test{Type};
|
||||
|
||||
def Callback = fn Type();
|
||||
alias Callback = fn Type();
|
||||
|
||||
module mymain;
|
||||
|
||||
import std::io;
|
||||
import test;
|
||||
|
||||
def VoidCb = test::Callback{void};
|
||||
alias VoidCb = test::Callback{void};
|
||||
|
||||
fn int main()
|
||||
{
|
||||
|
||||
@@ -2,8 +2,8 @@ module test;
|
||||
import std::io;
|
||||
|
||||
import abc;
|
||||
def Def2 = Def;
|
||||
def Test = abc::cde::Abc{int};
|
||||
alias Def2 = Def;
|
||||
alias Test = abc::cde::Abc{int};
|
||||
|
||||
module abc;
|
||||
|
||||
|
||||
@@ -7,5 +7,5 @@ struct Foo
|
||||
module bar;
|
||||
import foo;
|
||||
|
||||
def Bar = Foo{int, int}; // #error: Expected a value, not a type
|
||||
def Baz = Foo{5, 4}; // #error: Expected a type, not a value
|
||||
alias Bar = Foo{int, int}; // #error: Expected a value, not a type
|
||||
alias Baz = Foo{5, 4}; // #error: Expected a type, not a value
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// #target: macos-x64
|
||||
module broken{Type};
|
||||
distinct Bar = Type;
|
||||
def Bar2 = Type;
|
||||
alias Bar2 = Type;
|
||||
struct Baz
|
||||
{
|
||||
int a;
|
||||
|
||||
Reference in New Issue
Block a user