You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling code that contains non-exhaustive matches on case classes with multiple parameters like the test case below, the compiler uses excessive system resources. For the test case below, on my system scalac peaks to using over 2 GB of memory (when run with -J-Xmx4G) and does not finish compiling after running for 10 minutes. Adding a default case to make the match exhaustive or compiling with -Xno-patmat-analysis allows compilation to finish in reasonable time with compiler version 2.12.0, but was not necessary with version 2.11.8.
@retronym said:
The difference between 2.11.8 and 2.12.0 is that we have started to treat case classes as one-case-ADTs for the purposes of the analysis. If we introduce a sealed parent type, I get a OOME in 2.11.8:
In which the compiler doggedly attempts to produce an exhaustive list of counter examples. Were it possible to create these We can tell in advance that this is impractically large, the question is what to do instead in degrade to a useful counter example message.
When compiling code that contains non-exhaustive matches on case classes with multiple parameters like the test case below, the compiler uses excessive system resources. For the test case below, on my system
scalac
peaks to using over 2 GB of memory (when run with-J-Xmx4G
) and does not finish compiling after running for 10 minutes. Adding a default case to make the match exhaustive or compiling with-Xno-patmat-analysis
allows compilation to finish in reasonable time with compiler version 2.12.0, but was not necessary with version 2.11.8.Test case:
The text was updated successfully, but these errors were encountered: