Skip to content

Commit aaae90a

Browse files
authored
Fix Windows-only stack overflow (#27027)
Failing on main. I guess somewhere in Windows-only JVM code we use more stack at just the worst time. [test_windows_full] ## Have you relied on LLM-based tools in this contribution? No ## How was the solution tested? Covered by existing tests (this is a refactoring)
1 parent 1d03c4e commit aaae90a

2 files changed

Lines changed: 21 additions & 21 deletions

File tree

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3724,7 +3724,7 @@ class MatchReducer(initctx: Context) extends TypeComparer(initctx) {
37243724

37253725
override def matchReducer = this
37263726

3727-
def matchCases(scrut: Type, cases: List[MatchTypeCaseSpec])(using Context): Type = {
3727+
def matchCases(scrut: Type, cases: List[MatchTypeCaseSpec])(using Context): Type = ctx.handleRecursive("match cases for", scrut) {
37283728
// a reference for the type parameters poisoned during matching
37293729
// for use during the reduction step
37303730
var poisoned: Set[TypeParamRef] = Set.empty

tests/neg/i17132.min.check

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@
77
|For the unprocessed stack overflow trace, compile with -Xno-enrich-error-messages.
88
|A recurring operation is (inner to outer):
99
|
10-
| reduce match type for scrutinee t
11-
| reduce match type for scrutinee t
12-
| reduce match type for scrutinee t
13-
| reduce match type for scrutinee t
14-
| reduce match type for scrutinee t
15-
| reduce match type for scrutinee t
16-
| reduce match type for scrutinee t
17-
| reduce match type for scrutinee t
18-
| reduce match type for scrutinee t
19-
| reduce match type for scrutinee t
10+
| match cases for t
11+
| match cases for t
12+
| match cases for t
13+
| match cases for t
14+
| match cases for t
15+
| match cases for t
16+
| match cases for t
17+
| match cases for t
18+
| match cases for t
19+
| match cases for t
2020
| ...
2121
|
22-
| reduce match type for scrutinee t
23-
| reduce match type for scrutinee t
24-
| reduce match type for scrutinee t
25-
| reduce match type for scrutinee t
26-
| reduce match type for scrutinee t
27-
| reduce match type for scrutinee t
28-
| reduce match type for scrutinee t
29-
| reduce match type for scrutinee t
30-
| reduce match type for scrutinee t
31-
| reduce match type for scrutinee T
22+
| match cases for t
23+
| match cases for t
24+
| match cases for t
25+
| match cases for t
26+
| match cases for t
27+
| match cases for t
28+
| match cases for t
29+
| match cases for t
30+
| match cases for t
31+
| match cases for T

0 commit comments

Comments
 (0)