Closure in local context not parented by its enclosing function

I use source code from swift-5.8.1-RELEASE to build swiftc.
When I used it to compile my project, I got an error with tip " closure in local context not parented by its enclosing function ".

My code like this

public static func report(
        eventId: Int64,
        p1: String? = nil,
        p2: String? = nil,
        p3: String? = nil,
        extraDict: [String: String]? = ["uid": "\(DefautUser?.uerId ?? 0)"]) {
        // do something
    }

When I remove the default value, it can build success.

public static func report(
        eventId: Int64,
        p1: String? = nil,
        p2: String? = nil,
        p3: String? = nil,
        extraDict: [String: String]? = ["uid": "\(DefautUser?.uerId)"]) {
        // do something
    }

The crash log I got.

0  swift-frontend           0x000000010d186f97 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39
1  swift-frontend           0x000000010d186305 llvm::sys::RunSignalHandlers() + 85
2  swift-frontend           0x000000010d1875d0 SignalHandler(int) + 272
3  libsystem_platform.dylib 0x00007ff80dfae5ed _sigtramp + 29
4  libsystem_platform.dylib 0x3030303030303030 _sigtramp + 3472187592864516704
5  libsystem_c.dylib        0x00007ff80dea7b45 abort + 123
6  swift-frontend           0x000000010d751d44 (anonymous namespace)::Verifier::verifyChecked(swift::AbstractClosureExpr*) (.cold.4) + 84
7  swift-frontend           0x00000001095360a3 (anonymous namespace)::Verifier::verifyChecked(swift::AbstractClosureExpr*) + 611
8  swift-frontend           0x000000010952e8d8 swift::ASTWalker::PostWalkResult<swift::AutoClosureExpr*> (anonymous namespace)::Verifier::dispatchVisitPost<swift::AutoClosureExpr*>(swift::AutoClosureExpr*) + 184
9  swift-frontend           0x00000001095267b5 (anonymous namespace)::Verifier::walkToExprPost(swift::Expr*) + 1269
10 swift-frontend           0x000000010953a13c (anonymous namespace)::Traversal::doIt(swift::Expr*) + 988
11 swift-frontend           0x0000000109539e08 (anonymous namespace)::Traversal::doIt(swift::Expr*) + 168
12 swift-frontend           0x000000010953c8f9 (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) + 233
13 swift-frontend           0x0000000109539e2d (anonymous namespace)::Traversal::doIt(swift::Expr*) + 205
14 swift-frontend           0x000000010953c8f9 (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) + 233
15 swift-frontend           0x0000000109539e2d (anonymous namespace)::Traversal::doIt(swift::Expr*) + 205
16 swift-frontend           0x000000010953caf9 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) + 169
17 swift-frontend           0x000000010953c457 (anonymous namespace)::Traversal::visitTapExpr(swift::TapExpr*) + 183
18 swift-frontend           0x000000010953a0b4 (anonymous namespace)::Traversal::doIt(swift::Expr*) + 852
19 swift-frontend           0x000000010953afa7 (anonymous namespace)::Traversal::visitInterpolatedStringLiteralExpr(swift::InterpolatedStringLiteralExpr*) + 23
20 swift-frontend           0x000000010953a008 (anonymous namespace)::Traversal::doIt(swift::Expr*) + 680
21 swift-frontend           0x000000010953b527 (anonymous namespace)::Traversal::visitTupleExpr(swift::TupleExpr*) + 87
22 swift-frontend           0x000000010953a028 (anonymous namespace)::Traversal::doIt(swift::Expr*) + 712
23 swift-frontend           0x000000010953b63d swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visitDictionaryExpr(swift::DictionaryExpr*) + 61
24 swift-frontend           0x000000010953a0c1 (anonymous namespace)::Traversal::doIt(swift::Expr*) + 865
25 swift-frontend           0x0000000109539e08 (anonymous namespace)::Traversal::doIt(swift::Expr*) + 168
26 swift-frontend           0x000000010953e92a (anonymous namespace)::Traversal::visit(swift::Decl*) + 1002
27 swift-frontend           0x000000010953ae18 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 200
28 swift-frontend           0x000000010953fa6c (anonymous namespace)::Traversal::visitAbstractFunctionDecl(swift::AbstractFunctionDecl*) + 444
29 swift-frontend           0x000000010953e5be (anonymous namespace)::Traversal::visit(swift::Decl*) + 126
30 swift-frontend           0x000000010953ae18 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 200
31 swift-frontend           0x000000010953f74e (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 494
32 swift-frontend           0x000000010953e5ac (anonymous namespace)::Traversal::visit(swift::Decl*) + 108
33 swift-frontend           0x000000010953ae18 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 200
34 swift-frontend           0x000000010953ad3b swift::Decl::walk(swift::ASTWalker&) + 27
35 swift-frontend           0x00000001096e6a30 swift::SourceFile::walk(swift::ASTWalker&) + 304
36 swift-frontend           0x00000001095257e0 swift::verify(swift::SourceFile&) + 80
37 swift-frontend           0x00000001097f6b6a swift::TypeCheckSourceFileRequest::cacheResult(std::__1::tuple<>) const + 74
38 swift-frontend           0x0000000109316dd0 llvm::Expected<swift::TypeCheckSourceFileRequest::OutputType> swift::Evaluator::getResultCached<swift::TypeCheckSourceFileRequest, (void*)0>(swift::TypeCheckSourceFileRequest const&) + 96
39 swift-frontend           0x0000000109314d8f swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckSourceFileRequest>(swift::Evaluator&, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType) + 31
40 swift-frontend           0x000000010831c55c bool llvm::function_ref<bool (swift::SourceFile&)>::callback_fn<swift::CompilerInstance::performSema()::$_7>(long, swift::SourceFile&) + 12
41 swift-frontend           0x0000000108316c6e swift::CompilerInstance::forEachFileToTypeCheck(llvm::function_ref<bool (swift::SourceFile&)>) + 174
42 swift-frontend           0x0000000108316b9b swift::CompilerInstance::performSema() + 75
43 swift-frontend           0x00000001081a70b4 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 52
44 swift-frontend           0x0000000108198998 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 728
45 swift-frontend           0x0000000108197e7d swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2509
46 swift-frontend           0x0000000107fd9df5 swift::mainEntry(int, char const**) + 1205
47 dyld                     0x00007ff80dc2741f start + 1903

Looks like a bad interaction between string interpolation and @autoclosure. Do you mind filing a bug with a self-contained test case at Issues · apple/swift · GitHub?

I can't any syntax error in my code. I suppose that may be a bug.