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

build manager: Usage sites not recompiled when method is made specialized #2652

Closed
scabug opened this issue Nov 16, 2009 · 6 comments
Closed
Assignees

Comments

@scabug
Copy link

scabug commented Nov 16, 2009

Using: Scala version 2.8.0.r19673-b20091116132603 (OpenJDK 64-Bit Server VM, Java 1.6.0_0)

Given A.scala, B.scala

class A {
	def x[T](t: T) = t
}
object B {
	val y = (new A).x(3)
}
  1. Compile
  2. Make A.x specialized
class A {
	def x[@specialized T](t: T) = t
}
  1. Mark A.scala modified. Only A.scala is recompiled although B.scala must be as well in order to take advantage of specialization.
  2. Explicitly mark B.scala as modified. B.y now uses the specialized version of A.x.
@scabug
Copy link
Author

scabug commented Nov 16, 2009

Imported From: https://issues.scala-lang.org/browse/SI-2652?orig=1
Reporter: @harrah

@scabug
Copy link
Author

scabug commented Nov 17, 2009

@adriaanm said:
Hubert, I believe this is your department ;-)

@scabug
Copy link
Author

scabug commented Jan 20, 2010

@hubertp said:
(In r20624) Closes #2653, #2652, #2556. The last one required more sophisticated mechanism for detecting invalid references to inherited members, but at least it doesn't seem to cause unnecessary recompilations.

@scabug
Copy link
Author

scabug commented Jan 27, 2010

@harrah said:
If A.x is:

def x[@specialized("Int") T](t: T) = t

Modifying it to be:

def x[@specialized("Long") T](t: T) = t

causes B to correctly be recompiled because B used a specialized method that is now gone.

However, changing it back to "Int" will not recompile B because it uses the unspecialized method now and annotation arguments are not compared. B should be recompiled because x is now specialized to Int.

Replying to "Any others that should be checked?" in r20624, Java annotations are not supposed to modify the annotated source code, but Scala annotations can. Obviously serialized is an example of one. I've not used the continuations plugin, but it looks like changes to 'cps' need to be propagated.

I don't know about remote, serializable, throws, and cloneable. I don't think the added signatures are visible to Scala code, so they might be fine. I don't know what how the refined build manager is supposed to interact with Java sources, though, in which case it might matter.

Java annotations can cause messages to be displayed during compilation, however. A standard example is deprecated. This might warrant a blacklist instead of a whitelist for annotations, since you can't know all annotations and their behaviors.

@scabug
Copy link
Author

scabug commented Feb 4, 2010

@harrah said:
The @transient, @peer, and @unique annotations for the uniqueness plugin are examples of the disadvantage of a whitelist, since changes involving them won't get picked up until they are added to the whitelist.

Also, @peer takes arguments, so it probably has the same issue mentioned for @specialized and changing arguments. I only checked that changing @unique on a parameter's type was problematic, though.

(By whitelist, I mean how the build manager currently checks a list containing names of annotations that should be considered for changes.)

@scabug
Copy link
Author

scabug commented Feb 22, 2012

@hubertp said:
refined build manager is deprecated. bugs related to it will no longer be fixed.

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

No branches or pull requests

2 participants