Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 15811 - -transition=import and -transition=checkimport have…
… oddly behaviors
- Loading branch information
Showing
14 changed files
with
227 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// REQUIRED_ARGS: -transition=checkimports -de | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/checkimports1a.d(16): Deprecation: local import search method found struct imports.diag12598a.lines instead of variable checkimports1a.C.lines | ||
--- | ||
*/ | ||
|
||
|
||
// new lookup + information | ||
class C | ||
{ | ||
void f() | ||
{ | ||
import imports.diag12598a; | ||
lines ~= ""; | ||
} | ||
|
||
string[] lines; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// REQUIRED_ARGS: -transition=import -transition=checkimports | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/checkimports1b.d(16): Deprecation: local import search method found struct imports.diag12598a.lines instead of variable checkimports1b.C.lines | ||
fail_compilation/checkimports1b.d(16): Error: struct 'lines' is a type, not an lvalue | ||
--- | ||
*/ | ||
|
||
// old lookup + information | ||
class C | ||
{ | ||
void f() | ||
{ | ||
import imports.diag12598a; | ||
lines ~= ""; | ||
} | ||
|
||
string[] lines; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// REQUIRED_ARGS: -transition=checkimports -transition=import | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/checkimports1c.d(16): Deprecation: local import search method found struct imports.diag12598a.lines instead of variable checkimports1c.C.lines | ||
fail_compilation/checkimports1c.d(16): Error: struct 'lines' is a type, not an lvalue | ||
--- | ||
*/ | ||
|
||
// old lookup + information (the order of switches is reverse) | ||
class C | ||
{ | ||
void f() | ||
{ | ||
import imports.diag12598a; | ||
lines ~= ""; | ||
} | ||
|
||
string[] lines; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// REQUIRED_ARGS: -transition=checkimports | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/checkimports2a.d(23): Deprecation: class checkimports2a.B variable imports.imp2.Y found in local import | ||
fail_compilation/checkimports2a.d(27): Deprecation: local import search method found variable imports.imp1.Y instead of variable imports.imp2.Y | ||
fail_compilation/checkimports2a.d(23): Deprecation: class checkimports2a.B variable imports.imp2.X found in local import | ||
fail_compilation/checkimports2a.d(23): Deprecation: class checkimports2a.B variable imports.imp2.X found in local import | ||
fail_compilation/checkimports2a.d(32): Error: no property 'X' for type 'checkimports2a.B' | ||
fail_compilation/checkimports2a.d(23): Deprecation: class checkimports2a.B variable imports.imp2.Y found in local import | ||
fail_compilation/checkimports2a.d(33): Error: no property 'Y' for type 'checkimports2a.B' | ||
fail_compilation/checkimports2a.d(23): Deprecation: class checkimports2a.B variable imports.imp2.X found in local import | ||
fail_compilation/checkimports2a.d(23): Deprecation: class checkimports2a.B variable imports.imp2.Y found in local import | ||
--- | ||
*/ | ||
|
||
// new lookup + information | ||
|
||
import imports.imp1; | ||
|
||
enum X = 0; | ||
|
||
class B | ||
{ | ||
import imports.imp2; | ||
static assert(X == 0); // imp2.X --> .X | ||
int[Y] aa; // imp2.Y | ||
} | ||
|
||
class C : B | ||
{ | ||
static assert(B.X == 0); // imp2.X --> error | ||
static assert(B.Y == 2); // imp2.Y --> error | ||
|
||
static assert(X == 0); // imp2.X --> .X | ||
static assert(Y == 1); // imp2.Y --> imp1.Y | ||
} |
Oops, something went wrong.