| 1 |
/** |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/already_defined.d(4): Error: declaration `already_defined.func1.a` is already defined |
| 5 |
fail_compilation/already_defined.d(3): `variable` `a` is defined here |
| 6 |
fail_compilation/already_defined.d(10): Error: declaration `already_defined.func2.core` is already defined |
| 7 |
fail_compilation/already_defined.d(9): `import` `core` is defined here |
| 8 |
fail_compilation/already_defined.d(28): Error: declaration `Ident(T)` is already defined |
| 9 |
fail_compilation/already_defined.d(27): `template` `Ident(T)` is defined here |
| 10 |
fail_compilation/already_defined.d(36): Error: declaration `Tstring` is already defined |
| 11 |
fail_compilation/already_defined.d(35): `alias` `Tstring` is defined here |
| 12 |
fail_compilation/already_defined.d(42): Error: declaration `T` is already defined |
| 13 |
fail_compilation/already_defined.d(41): `alias` `T` is defined here |
| 14 |
fail_compilation/already_defined.d(48): Error: declaration `core` is already defined |
| 15 |
fail_compilation/already_defined.d(47): `import` `core` is defined here |
| 16 |
fail_compilation/already_defined.d(54): Error: declaration `core` is already defined |
| 17 |
fail_compilation/already_defined.d(53): `import` `core` is defined here |
| 18 |
--- |
| 19 |
*/ |
| 20 |
|
| 21 |
#line 1 |
| 22 |
void func1 () |
| 23 |
{ |
| 24 |
int a; |
| 25 |
bool a; |
| 26 |
} |
| 27 |
|
| 28 |
void func2 () |
| 29 |
{ |
| 30 |
import core.stdc.stdio; |
| 31 |
string core; |
| 32 |
} |
| 33 |
|
| 34 |
void func3 () |
| 35 |
{ |
| 36 |
{ |
| 37 |
import core.stdc.stdio; |
| 38 |
} |
| 39 |
|
| 40 |
{ |
| 41 |
// No conflict |
| 42 |
string core; |
| 43 |
} |
| 44 |
} |
| 45 |
|
| 46 |
void func4 () |
| 47 |
{ |
| 48 |
template Ident (T) { alias Ident = T; } |
| 49 |
template Ident (T) { alias Ident = T; } |
| 50 |
} |
| 51 |
|
| 52 |
void func5 () |
| 53 |
{ |
| 54 |
template Ident (T) { alias Ident = T; } |
| 55 |
|
| 56 |
alias Tstring = Ident!string; |
| 57 |
alias Tstring = Ident!string; |
| 58 |
} |
| 59 |
|
| 60 |
void func6 () |
| 61 |
{ |
| 62 |
static if (is(int T == int)) {} |
| 63 |
static if (is(int T == int)) {} |
| 64 |
} |
| 65 |
|
| 66 |
void func7 () |
| 67 |
{ |
| 68 |
import core.stdc.stdio; |
| 69 |
static if (is(int core == int)) {} |
| 70 |
} |
| 71 |
|
| 72 |
void func8 () |
| 73 |
{ |
| 74 |
import core.stdc.stdio; |
| 75 |
static if (is(string : core[], core)) {} |
| 76 |
} |