mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Drop a superfluous NULL write
Storing NULL here on failure is brittle and was only necessary when the typechecker was leaking type variables in expressions. Now that we're better about this, it's best to preserve the damaged AST.
This commit is contained in:
@@ -6021,13 +6021,8 @@ ParamDecl::getDefaultValueStringRepresentation(
|
||||
if (!existing.empty())
|
||||
return existing;
|
||||
|
||||
if (!getDefaultValue()) {
|
||||
// TypeChecker::checkDefaultArguments() nulls out the default value
|
||||
// if it fails to type check it. This only seems to happen with an
|
||||
// invalid/incomplete parameter list that contains a parameter with an
|
||||
// unresolved default value.
|
||||
return "<<empty>>";
|
||||
}
|
||||
assert(getDefaultValue()
|
||||
&& "Normal default argument with no default expression?!");
|
||||
return extractInlinableText(getASTContext().SourceMgr, getDefaultValue(),
|
||||
scratch);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user