Skip to content

inconsistent code generation depending on use of -optimise #2317

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
scabug opened this issue Sep 2, 2009 · 5 comments
Closed

inconsistent code generation depending on use of -optimise #2317

scabug opened this issue Sep 2, 2009 · 5 comments
Assignees

Comments

@scabug
Copy link

scabug commented Sep 2, 2009

Problem exists in trunk, but not in 2.7.4. The basic idea is that if I have a library A that doesn't use -optimise, and then I build a library B that extends a trait in library A with class C, and library B does use optimize, then the generated code is wrong and fails at runtime.

If they're all compiled together, it doesn't seem to be a problem.

Steps:

  mkdir classes
  scalac -d classes Tensor.scala
  scalac -optimise -d classes DoubleCounter.scala
  scala -cp classes/
Welcome to Scala version 2.8.0.r0-b20090901205458 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_07).
Type in expressions to have them evaluated.
Type :help for more information.
  scala> new DoubleCounter()
java.lang.NoSuchMethodError: TensorSelfOp$$class.$$init$$(LTensorSelfOp;)V
        at DoubleCounter.<init>(DoubleCounter.scala:1)
        at .<init>(<console>:5)
        at .<clinit>(<console>)
        at RequestResult$$.<init>(<console>:4)
        at RequestResult$$.<clinit>(<console>)
        at RequestResult$$result(<console>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImp...

There's a good chance this example could be made more minimal, but I'm not sure.

(Also, can we please have an -optimize alias for -optimise. Ignorant Americans and such 😄

@scabug
Copy link
Author

scabug commented Sep 2, 2009

Imported From: https://issues.scala-lang.org/browse/SI-2317?orig=1
Reporter: @dlwh
Attachments:

@scabug
Copy link
Author

scabug commented Sep 2, 2009

@dlwh said:
File #1 (DoubleCounter, in Library B)

@scabug
Copy link
Author

scabug commented Sep 2, 2009

@dlwh said:
File 2, Tensor.scala

@scabug
Copy link
Author

scabug commented Sep 2, 2009

@dragos said:
This might be a duplicate of #1995.

@scabug
Copy link
Author

scabug commented Sep 4, 2009

@dragos said:
Fixed in r18643.

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