-
Notifications
You must be signed in to change notification settings - Fork 620
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 #3707 from ntrel/d-template
D: set template members parent name
- Loading branch information
Showing
6 changed files
with
50 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 @@ | ||
--sort=no |
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,12 @@ | ||
Template input.d /^template Template(alias a, T...)$/;" T file: | ||
TemplateAlias input.d /^ alias TemplateAlias = a!T;$/;" a template:Template file: | ||
memb input.d /^ int memb;$/;" m template:Template file: | ||
b input.d /^Foo!x b;$/;" v | ||
each input.d /^template each(alias fun = "a")$/;" T file: | ||
child input.d /^ template child(){}$/;" T template:each file: | ||
tmethod input.d /^ void tmethod()(){}$/;" f template:each | ||
ImplementLength input.d /^mixin ImplementLength!source; \/\/ FIXME source too!$/;" X | ||
source input.d /^mixin ImplementLength!source; \/\/ FIXME source too!$/;" X | ||
IT input.d /^interface IT(T){}$/;" i file: | ||
ST input.d /^struct ST(T){}$/;" s file: | ||
UT input.d /^union UT(T){}$/;" u file: |
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,34 @@ | ||
template Template(alias a, T...) | ||
if (is(typeof(a))) | ||
{ | ||
private: | ||
// no parent: | ||
alias TemplateAlias = a!T; | ||
int memb; | ||
} | ||
|
||
Foo!x b; | ||
Foo!(x) c; // FIXME | ||
Foo!(x < 2) d; // FIXME | ||
void f(Foo!x); // FIXME | ||
|
||
template each(alias fun = "a") | ||
{ | ||
template child(){} | ||
void tmethod()(){} | ||
} | ||
|
||
// FIXME | ||
/+ | ||
int vt(alias a) = 0; // not parsed | ||
// parsed as T: | ||
alias AT(T) = T; | ||
enum ET(T) = T.init; | ||
+/ | ||
|
||
mixin ImplementLength!source; // FIXME source too! | ||
|
||
// declaration templates | ||
interface IT(T){} | ||
struct ST(T){} | ||
union UT(T){} |
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