Skip to content

Conversation

@allevato
Copy link
Member

@allevato allevato commented Dec 3, 2025

`ModuleType`s show up in some rare places, like the left-hand-side of
a `DotSyntaxBaseIgnoredExpr` for a module-qualified function call.
ASTMangler does not support these because they're not real types.
This avoids infinite recursion when a function captures itself; e.g.,

```swift
func foo() {
  func bar() {
    bar()
  }
  bar()
}
```

It also just avoids printing unnecessarily verbose information,
since those decls would have already been dumped elsewhere in the
tree.
By calling `printCommon` twice, this inserts a JSON object into
another JSON object without a key. This asserts inside LLVM's
JSON helper, but only if the compiler is built with assertions
enabled (which Xcode's compiler doesn't).

This also fixes the S-expression version, which is similarly busted:

```
(pattern_entry
  (async_let  type="Int"              (pattern_any type="Int")
  (original_init=call_expr type="Int" ...
```
@allevato allevato requested a review from a team as a code owner December 3, 2025 13:31
@allevato
Copy link
Member Author

allevato commented Dec 3, 2025

@swift-ci please test

@allevato allevato enabled auto-merge December 3, 2025 19:26
@allevato allevato merged commit e95f5a1 into swiftlang:release/6.3 Dec 3, 2025
5 checks passed
@allevato allevato deleted the json-ast-fixes-6.3 branch December 4, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants