Skip to content
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

test/files/run/tailcalls.scala fails on runtimes with proper tail calls #7479

Closed
scabug opened this issue May 13, 2013 · 3 comments
Closed
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented May 13, 2013

It fails with “calibration failure”, while it tries to run a supposedly non-tail-call-optimized method (which is of course optimized on platforms which support tail calls).

  def calibrate: Int = {
    val calibrator = new Calibrator();
    var stop = false;
    var n = 1;
    while (!stop) {
      try {
        calibrator.f(n, n);
        if (n >= Int.MaxValue / 2) sys.error("calibration failure");
        n = 2 * n;
      } catch {
        case exception: compat.Platform.StackOverflowError => stop = true
      }
    }
    4 * n
  }

Apart from that, it also hardcodes that certain methods fail with a StackOverflowError in the checkfile, which is not true on all platforms.

As mentioned in https://groups.google.com/d/topic/scala-internals/FDuwuP1daAg/discussion, I'll just check for Avian and make the test pass.

@scabug
Copy link
Author

scabug commented May 13, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7479?orig=1
Reporter: @soc
Affected Versions: 2.11.0-M2

@scabug
Copy link
Author

scabug commented May 13, 2013

@soc said:
scala/scala#2528

@scabug
Copy link
Author

scabug commented May 18, 2013

@soc said:
scala/scala#2561

@scabug scabug closed this as completed Jun 18, 2013
@scabug scabug added this to the 2.11.0-M4 milestone Apr 7, 2017
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

No branches or pull requests

2 participants