Skip to content

Commit 0fd25e9

Browse files
committed
[spec] List symbols which can be aliased
Make template example runnable. Add link.
1 parent 467f934 commit 0fd25e9

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

spec/declaration.dd

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,16 @@ $(GNAME AliasAssignment):
243243

244244
$(P $(I AliasDeclaration)s create a symbol name that refers to another symbol.
245245
That symbol name can be used anywhere that the aliased symbol may appear.
246+
The following symbols can be aliased:
246247
)
248+
* $(RELATIVE_LINK2 alias-type, Types)
249+
* $(RELATIVE_LINK2 alias-variable, Variables)
250+
* Constants
251+
* Modules
252+
* Packages
253+
* Function Literals
254+
* Templates
255+
* Template Instantiations
247256

248257
$(H3 $(LNAME2 alias-type, Type Aliases))
249258

@@ -294,6 +303,7 @@ $(H3 $(LNAME2 alias-symbol, Symbol Aliases))
294303
The following alias declarations are valid:
295304
)
296305

306+
$(SPEC_RUNNABLE_EXAMPLE_COMPILE
297307
--------------------
298308
template Foo2(T) { alias t = T; }
299309
alias t1 = Foo2!(int);
@@ -306,6 +316,7 @@ t2 v2; // v2 is type int
306316
t3 v3; // v3 is type int
307317
t4 v4; // v4 is type int
308318
---
319+
)
309320

310321
$(P
311322
Aliased symbols are useful as a shorthand for a long qualified
@@ -325,11 +336,13 @@ version (linux)
325336
--------------------
326337

327338
$(P
328-
Aliasing can be used to `import` a symbol from an import into the
329-
current scope:
339+
Aliasing can be used to $(DDSUBLINK spec/module, import-declaration, `import`)
340+
a symbol from an import into the current scope:
330341
)
331342

332343
--------------------
344+
static import string;
345+
...
333346
alias strlen = string.strlen;
334347
--------------------
335348

@@ -563,7 +576,7 @@ storage within the module. They must be defined in some other object file with a
563576
matching name which is then linked in.)
564577

565578
$(P An $(D extern) declaration can optionally be followed by an $(D extern)
566-
$(LINK2 attribute.html$(HASH)linkage, linkage attribute). If there is no linkage
579+
$(DDSUBLINK spec/attribute, linkage, linkage attribute). If there is no linkage
567580
attribute it defaults to $(D extern(D)):)
568581

569582
---------------

0 commit comments

Comments
 (0)