Skip to content

Commit f4b4e99

Browse files
authored
[spec] Update function type grammar (#3725)
See dlang/dmd#15805.
1 parent 6e69877 commit f4b4e99

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spec/declaration.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ $(GNAME AliasAssignments):
263263
$(GNAME AliasAssignment):
264264
$(GLINK_LEX Identifier) $(GLINK2 template, TemplateParameters)$(OPT) $(D =) $(GLINK StorageClasses)$(OPT) $(GLINK2 type, Type)
265265
$(GLINK_LEX Identifier) $(GLINK2 template, TemplateParameters)$(OPT) $(D =) $(GLINK2 expression, FunctionLiteral)
266-
$(GLINK_LEX Identifier) $(GLINK2 template, TemplateParameters)$(OPT) $(D =) $(GLINK StorageClasses)$(OPT) $(GLINK2 type, BasicType) $(GLINK2 function, Parameters) $(GLINK2 function, MemberFunctionAttributes)$(OPT)
266+
$(GLINK_LEX Identifier) $(GLINK2 template, TemplateParameters)$(OPT) $(D =) $(GLINK StorageClasses)$(OPT) $(GLINK2 type, Type) $(GLINK2 function, Parameters) $(GLINK2 function, MemberFunctionAttributes)$(OPT)
267267
)
268268

269269
$(P An $(I AliasDeclaration) creates a symbol name that refers to a type or another symbol.

spec/type.dd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,8 @@ $(H2 $(LNAME2 functions, Function Types))
553553

554554
$(P A function type has the form:)
555555

556-
$(GRAMMAR
557-
$(GLINK TypeCtor)$(OPT) $(GLINK BasicType) $(GLINK2 function, Parameters) $(GLINK2 function, FunctionAttributes)$(OPT)
556+
$(GRAMMAR_INFORMATIVE
557+
$(GLINK2 declaration, StorageClasses)$(OPT) $(GLINK Type) $(GLINK2 function, Parameters) $(GLINK2 function, FunctionAttributes)$(OPT)
558558
)
559559

560560
$(P A function type e.g. `int(int)` is only used for type tests.
@@ -563,7 +563,7 @@ A function type $(DDSUBLINK spec/declaration, alias-function, can be aliased).)
563563
$(P Instantiating a function type is illegal. Instead, a pointer to function
564564
or delegate can be used. Those have these type forms respectively:)
565565

566-
$(GRAMMAR
566+
$(GRAMMAR_INFORMATIVE
567567
$(GLINK TypeCtor)$(OPT) $(GLINK BasicType) $(GLINK TypeSuffixes) `function` $(GLINK2 function, Parameters) $(GLINK2 function, FunctionAttributes)$(OPT)
568568
$(GLINK TypeCtor)$(OPT) $(GLINK BasicType) $(GLINK TypeSuffixes) `delegate` $(GLINK2 function, Parameters) $(GLINK2 function, MemberFunctionAttributes)$(OPT)
569569
)

0 commit comments

Comments
 (0)