File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
TSPL.docc/ReferenceManual Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1544,6 +1544,16 @@ are expressions that contain a macro ---
1544
1544
the macros in those expressions are evaluated
1545
1545
using the source code location where `f (a:b:c: )` is defined.
1546
1546
1547
+ When you use a macro as a default value,
1548
+ it's type checked without expanding the macro,
1549
+ to check the following requirements:
1550
+
1551
+ - The macro either takes no arguments,
1552
+ or its arguments are literals without string interpolation.
1553
+ - The macro's return type matches the parameter's type.
1554
+ - The access level for the macro's return type
1555
+ is the same as or less restrictive than the function that uses it.
1556
+
1547
1557
You use macro expressions to call freestanding macros.
1548
1558
To call an attached macro,
1549
1559
use the custom attribute syntax described in < doc: Attributes> .
You can’t perform that action at this time.
0 commit comments