Skip to content

Compiler "hangs" for 1+ minutes on a one line input. #9344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sir-wabbit opened this issue Jul 11, 2020 · 1 comment · Fixed by #10985
Closed

Compiler "hangs" for 1+ minutes on a one line input. #9344

sir-wabbit opened this issue Jul 11, 2020 · 1 comment · Fixed by #10985

Comments

@sir-wabbit
Copy link

Found an example that takes "forever" (1-2 minutes) to compile (with an error!)

Minimized code

// TD-184aaea3a529ccf09be73fa770e0aba21f73983c
val I1: Int = 0 * * * 8 * 1 - 1 + 1 +

Output

sbt:dotty> dotc test.scala
[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list
[info] running (fork) dotty.tools.dotc.Main -classpath /Users/akonovalov/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.3/scala-library-2.13.3.jar:/Users/akonovalov/Documents/projects/dotty-fork/library/../out/bootstrap/dotty-library-bootstrapped/scala-0.26/dotty-library_0.26-0.26.0-bin-SNAPSHOT.jar test.scala
-- Error: test.scala:1:32 ------------------------------------------------------
1 |val I1: Int = 0 * * * 8 * 1 - 1 + 1 +
  |              ^^^^^^^^^^^^^^^^^^^^^
  |postfix operator `+` needs to be enabled
  |by making the implicit value scala.language.postfixOps visible.
  |----
  |This can be achieved by adding the import clause 'import scala.language.postfixOps'
  |or by setting the compiler option -language:postfixOps.
  |See the Scaladoc for value scala.language.postfixOps for a discussion
  |why the feature needs to be explicitly enabled.
1 error found
[error] Nonzero exit code returned from runner: 1
[error] (dotty-compiler / Compile / runMain) Nonzero exit code returned from runner: 1
[error] Total time: 119 s (01:59), completed Jul 10, 2020 9:27:33 PM

Expectation

Shouldn't take THAT long to finish.

@odersky
Copy link
Contributor

odersky commented Jan 3, 2021

I now see 22 seconds, which is not too outrageously bad given the crazy input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants