inline parameter: assignment to local variable between its declaration and the call causes the incompilable code (IDEA-52164)

This commit is contained in:
anna
2010-02-11 17:56:33 +03:00
parent 208129c56b
commit 2d7473841b
3 changed files with 47 additions and 0 deletions
@@ -0,0 +1,31 @@
public class ExpData {
public void use(Object p) {
System.out.println(p);
}
public void context() {
ObjectType v1 = new ObjectType();
v1 = v1.provide();
inline1(v1);
int v2 = 1;
v2 += System.identityHashCode(new Object());
inline2(v2);
}
public void inline1(ObjectType <caret>subj) {
use(subj);
}
public void inline2(int subj) {
use(subj);
}
}
class ObjectType {
private int value = 1;
public ObjectType provide() {
return new ObjectType();
}
}