| 1 |
/* |
| 2 |
REQUIRED_ARGS: -vcg-ast -o- |
| 3 |
PERMUTE_ARGS: |
| 4 |
OUTPUT_FILES: compilable/vcg-ast.d.cg |
| 5 |
EXTRA_FILES: imports/vcg_ast_import.d |
| 6 |
TEST_OUTPUT_FILE: extra-files/vcg-ast.d.cg |
| 7 |
*/ |
| 8 |
|
| 9 |
module vcg; |
| 10 |
|
| 11 |
alias xyz = __traits(parent, {}); |
| 12 |
alias named = vcg; |
| 13 |
|
| 14 |
template Seq(A...) |
| 15 |
{ |
| 16 |
alias Seq = A; |
| 17 |
} |
| 18 |
|
| 19 |
auto a = Seq!(1,2,3); |
| 20 |
|
| 21 |
|
| 22 |
template R(T) |
| 23 |
{ |
| 24 |
struct _R { T elem; } |
| 25 |
} |
| 26 |
|
| 27 |
typeof(R!int._R.elem) x; |
| 28 |
|
| 29 |
|
| 30 |
static foreach(enum i; 0..3) |
| 31 |
{ |
| 32 |
mixin("int a" ~ i.stringof ~ " = 1;"); |
| 33 |
} |
| 34 |
|
| 35 |
void foo() |
| 36 |
{ |
| 37 |
static foreach(enum i; 0..3) |
| 38 |
{ |
| 39 |
mixin("int a" ~ i.stringof ~ " = 1;"); |
| 40 |
} |
| 41 |
} |
| 42 |
|
| 43 |
class C |
| 44 |
{ |
| 45 |
invariant {} |
| 46 |
invariant (true); |
| 47 |
|
| 48 |
int foo() in{} out{} out(r){} in(true) out(; true) out(r; true) |
| 49 |
{ |
| 50 |
return 2; |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
enum __c_wchar_t : dchar; |
| 55 |
alias wchar_t = __c_wchar_t; |
| 56 |
|
| 57 |
T[] values(T)() |
| 58 |
{ |
| 59 |
T[] values = [T()]; |
| 60 |
return values; |
| 61 |
} |
| 62 |
|
| 63 |
void main() |
| 64 |
{ |
| 65 |
values!wchar_t; |
| 66 |
} |
| 67 |
|
| 68 |
// https://issues.dlang.org/show_bug.cgi?id=24764 |
| 69 |
|
| 70 |
import imports.vcg_ast_import; |
| 71 |
|
| 72 |
template imported() |
| 73 |
{ |
| 74 |
import imported = imports.vcg_ast_import; |
| 75 |
} |
| 76 |
|
| 77 |
alias myImport = imported!(); |