Skip to content

Commit 9ca53f3

Browse files
authored
Merge pull request #3422 from ntrel/alias
[spec] List symbols which can be aliased Signed-off-by: Dennis <dkorpel@users.noreply.github.com> Merged-on-behalf-of: Dennis <dkorpel@users.noreply.github.com>
2 parents ebbf91a + ee72c85 commit 9ca53f3

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

spec/declaration.dd

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,17 @@ $(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+
* Functions
254+
* Function Literals
255+
* Templates
256+
* Template Instantiations
247257

248258
$(H3 $(LNAME2 alias-type, Type Aliases))
249259

@@ -294,6 +304,7 @@ $(H3 $(LNAME2 alias-symbol, Symbol Aliases))
294304
The following alias declarations are valid:
295305
)
296306

307+
$(SPEC_RUNNABLE_EXAMPLE_COMPILE
297308
--------------------
298309
template Foo2(T) { alias t = T; }
299310
alias t1 = Foo2!(int);
@@ -306,6 +317,7 @@ t2 v2; // v2 is type int
306317
t3 v3; // v3 is type int
307318
t4 v4; // v4 is type int
308319
---
320+
)
309321

310322
$(P
311323
Aliased symbols are useful as a shorthand for a long qualified
@@ -325,11 +337,13 @@ version (linux)
325337
--------------------
326338

327339
$(P
328-
Aliasing can be used to `import` a symbol from an import into the
329-
current scope:
340+
Aliasing can be used to $(DDSUBLINK spec/module, import-declaration, `import`)
341+
a symbol from an imported module or package into the current scope:
330342
)
331343

332344
--------------------
345+
static import string;
346+
...
333347
alias strlen = string.strlen;
334348
--------------------
335349

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

565579
$(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
580+
$(DDSUBLINK spec/attribute, linkage, linkage attribute). If there is no linkage
567581
attribute it defaults to $(D extern(D)):)
568582

569583
---------------

0 commit comments

Comments
 (0)