Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3388 from 9rnsr/fix12242
Issue 12242 - conflict error with public imports
- Loading branch information
Showing
9 changed files
with
157 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module imports.imp12242a; | ||
|
||
public: | ||
import imports.imp12242a1; // std.string | ||
import imports.imp12242a2; // std.algorithm | ||
|
||
|
||
private mixin template MixTmp(T, int x) | ||
{ | ||
template foo(U) if (is(U == T)) | ||
{ | ||
enum foo = x; | ||
} | ||
} | ||
|
||
mixin MixTmp!(int, 1); | ||
mixin MixTmp!(long, 2); |
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,8 @@ | ||
module imports.imp12242a1; | ||
|
||
// std.string.strip | ||
int stripA(C)(C[] str) @safe pure | ||
if (is(immutable C == immutable char)) | ||
{ | ||
return 1; | ||
} |
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,11 @@ | ||
module imports.imp12242a2; | ||
|
||
// std.algorithm.strip | ||
auto stripA(R, E)(R range, E element) | ||
{ | ||
return 2; | ||
} | ||
auto stripA(alias pred, R)(R range) | ||
{ | ||
return 3; | ||
} |
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,17 @@ | ||
module imports.imp12242b; | ||
|
||
public: | ||
import imports.imp12242b1; // std.string | ||
import imports.imp12242b2; // std.algorithm | ||
|
||
|
||
private mixin template MixTmp(T, int x) | ||
{ | ||
template foo(U) if (is(U == T)) | ||
{ | ||
enum foo = x; | ||
} | ||
} | ||
|
||
mixin MixTmp!(float, 3); | ||
mixin MixTmp!(real, 4); |
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,8 @@ | ||
module imports.imp12242b1; | ||
|
||
// std.string.strip | ||
int stripB(C)(C[] str) @safe pure | ||
if (is(immutable C == immutable char)) | ||
{ | ||
return 1; | ||
} |
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,11 @@ | ||
module imports.imp12242b2; | ||
|
||
// std.algorithm.strip | ||
auto stripB(R, E)(R range, E element) | ||
{ | ||
return 2; | ||
} | ||
auto stripB(alias pred, R)(R range) | ||
{ | ||
return 3; | ||
} |
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,26 @@ | ||
// PERMUTE_ARGS: | ||
|
||
module testimport12242; | ||
|
||
import imports.imp12242a; // test // stripA == OverloadSet | ||
import imports.imp12242a1; // std.string // stripA == template | ||
|
||
import imports.imp12242b1; // std.string // stripB == template | ||
import imports.imp12242b; // test // stripB == OverloadSet | ||
|
||
void main() | ||
{ | ||
static assert(stripA(" af ") == 1); | ||
static assert(" af ".stripA() == 1); // UFCS (1) | ||
static assert(" af ".stripA == 1); // UFCS (2) | ||
|
||
static assert(stripB(" af ") == 1); | ||
static assert(" af ".stripB() == 1); // UFCS (1) | ||
static assert(" af ".stripB == 1); // UFCS (2) | ||
|
||
|
||
static assert(foo!int == 1); | ||
static assert(foo!long == 2); | ||
static assert(foo!float == 3); | ||
static assert(foo!real == 4); | ||
} |