Skip to content

Commit fcbf0d4

Browse files
authored
[spec/declaration] Tweak alias docs (#3566)
1 parent 7c48ae3 commit fcbf0d4

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

spec/declaration.dd

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,19 +243,22 @@ $(GNAME AliasAssignment):
243243
$(GLINK_LEX Identifier) $(GLINK2 template, TemplateParameters)$(OPT) $(D =) $(GLINK StorageClasses)$(OPT) $(GLINK2 type, BasicType) $(GLINK2 function, Parameters) $(GLINK2 function, MemberFunctionAttributes)$(OPT)
244244
)
245245

246-
$(P $(I AliasDeclaration)s create a symbol name that refers to another symbol.
247-
That symbol name can be used anywhere that the aliased symbol may appear.
248-
The following symbols can be aliased:
246+
$(P An $(I AliasDeclaration) creates a symbol name that refers to a type or another symbol.
247+
That name can then be used anywhere that the target may appear.
248+
The following can be aliased:
249249
)
250250
* $(RELATIVE_LINK2 alias-type, Types)
251+
* $(RELATIVE_LINK2 alias-function, Function Types) (with default arguments)
251252
* $(RELATIVE_LINK2 alias-variable, Variables)
252-
* Constants
253+
* Manifest Constants
253254
* Modules
254255
* Packages
255256
* Functions
256-
* Function Literals
257+
* $(RELATIVE_LINK2 alias-overload, Overload Sets)
258+
* $(DDSUBLINK spec/expression, function-literal-alias, Function Literals)
257259
* Templates
258260
* Template Instantiations
261+
* Other Alias Declarations
259262

260263
$(H3 $(LNAME2 alias-type, Type Aliases))
261264

@@ -339,8 +342,9 @@ version (linux)
339342
--------------------
340343

341344
$(P
342-
Aliasing can be used to $(DDSUBLINK spec/module, import-declaration, `import`)
343-
a symbol from an imported module or package into the current scope:
345+
Aliasing can be used to 'import' a symbol from an
346+
$(DDSUBLINK spec/module, import-declaration,
347+
imported module or package) into the current scope:
344348
)
345349

346350
--------------------
@@ -352,7 +356,7 @@ alias strlen = string.strlen;
352356
$(H3 $(LNAME2 alias-overload, Aliasing an Overload Set))
353357

354358
$(P
355-
Aliases can also `import` a set of overloaded functions, that can
359+
Aliases can also 'import' a set of overloaded functions, that can
356360
be overloaded with functions in the current scope:
357361
)
358362

spec/expression.dd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2223,11 +2223,13 @@ $(H4 $(LNAME2 lambda-parameter-inference, Parameter Type Inference))
22232223
auto fp = (i) { return 1; }; // error, cannot infer type of `i`
22242224
---
22252225

2226+
$(H5 $(LNAME2 function-literal-alias, Function Literal Aliasing))
2227+
22262228
$(P If a function literal is
22272229
$(DDSUBLINK spec/declaration, alias, aliased), the inference
22282230
of the parameter types is done when the types are needed, as
22292231
the function literal becomes a
2230-
$(DDSUBLINK spec/template, function-templates, template).)
2232+
$(DDSUBLINK spec/template, function-templates, function template).)
22312233

22322234
$(SPEC_RUNNABLE_EXAMPLE_COMPILE
22332235
---

0 commit comments

Comments
 (0)