mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Parse: Fix crash in error recovery path with specifier before parameter name
We should let Sema set ParamDecl's specifier always, instead of setting it in the parser in this odd corner case where we're recovering from 'inout' being written before the parameter name.
This commit is contained in:
@@ -425,7 +425,7 @@ mapParsedParameters(Parser &parser,
|
||||
Identifier argName, SourceLoc argNameLoc,
|
||||
Identifier paramName, SourceLoc paramNameLoc)
|
||||
-> ParamDecl * {
|
||||
auto param = new (ctx) ParamDecl(paramInfo.SpecifierKind,
|
||||
auto param = new (ctx) ParamDecl(VarDecl::Specifier::Default,
|
||||
paramInfo.SpecifierLoc,
|
||||
argNameLoc, argName,
|
||||
paramNameLoc, paramName, Type(),
|
||||
|
||||
Reference in New Issue
Block a user