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 #2840 from 9rnsr/fix10938
Issue 10938 - ICE on recursive instantiation in opDispatch
- Loading branch information
Showing
8 changed files
with
60 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module imports.stdio4003; | ||
|
||
import imports.typecons4003; |
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,6 @@ | ||
module imports.test4003a; | ||
|
||
import imports.typecons4003; | ||
|
||
Tuple!(string) t; | ||
|
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,22 @@ | ||
module imports.typecons4003; | ||
|
||
struct Tuple(T...) | ||
{ | ||
alias T Types; | ||
Types field; | ||
|
||
ref Tuple!(Types[from .. to]) slice(uint from, uint to)() | ||
{ | ||
return *cast(typeof(return) *) &(field[from]); | ||
} | ||
|
||
void test() //unittest | ||
{ | ||
.Tuple!(int, string, float, double) a; | ||
a.field[1] = "abc"; | ||
a.field[2] = 4.5; | ||
auto s = a.slice!(1, 3); | ||
static assert(is(typeof(s) == Tuple!(string, float))); | ||
//assert(s.field[0] == "abc" && s.field[1] == 4.5); | ||
} | ||
} |
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,6 @@ | ||
// EXTRA_SOURCES: imports/test4003a.d | ||
// PERMUTE_ARGS: | ||
|
||
import imports.stdio4003; | ||
void main(){} | ||
|
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,23 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/ice10938.d(12): Error: no property 'opts' for type 'ice10938.C' | ||
--- | ||
*/ | ||
|
||
class C | ||
{ | ||
this() | ||
{ | ||
this.opts["opts"] = 1; | ||
} | ||
|
||
auto opDispatch(string field : "opts")() | ||
{ | ||
return this.opts; // ICE -> compile time error | ||
} | ||
} | ||
|
||
void main() | ||
{ | ||
} |