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
Parameter name changed after compilation #6028
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6028?orig=1 |
@adriaanm said: |
@paulp said: beforePickler {
// The param symbol in the MethodType should not be renamed, only the symbol in scope. This way,
// parameter names for named arguments are not changed. Example: without cloning the MethodType,
// def closure(x: Int) = { () => x }
// would have the signature
// closure: (x$1: Int)() => Int
if (sym.isParameter && sym.owner.info.paramss.exists(_ contains sym))
sym.owner modifyInfo (_ cloneInfo sym.owner)
} |
@retronym said (edited on Jul 6, 2012 10:20:10 PM UTC): |
@retronym said:
|
@retronym said: ticket/6028 ~/code/scala cat test/files/pos/t6028.scala
class T {
def foo(a: Int) = {val b = 0 ; () => a + b }
}
ticket/6028 ~/code/scala diff -u pre-6028.txt post-6028.txt
--- pre-6028.txt 2012-07-07 11:49:06.000000000 +0200
+++ post-6028.txt 2012-07-07 11:47:53.000000000 +0200
@@ -1,14 +1,14 @@
-[[syntax trees at end of lambdalift]]// Scala source: t6028.scala
+[[syntax trees at end of lambdalift]] // t6028.scala
package <empty> {
class T extends Object {
def <init>(): T = {
T.super.<init>();
()
};
- def foo(a$1: Int): Function0 = {
- val b$1: Int = 0;
+ def foo(a: Int): Function0 = {
+ val b: Int = 0;
{
- (new anonymous class $anonfun$foo$1(T.this, a$1, b$1): Function0)
+ (new anonymous class $anonfun$foo$1(T.this, a, b): Function0)
}
};
@SerialVersionUID(0) final <synthetic> class $anonfun$foo$1 extends scala.runtime.AbstractFunction0$mcI$sp with Serializable {
@@ -25,5 +25,4 @@
<synthetic> <paramaccessor> private[this] val b$1: Int = _
}
}
-}
-
+} |
@retronym said: |
@paulp said: Awesome! |
@retronym said: |
@retronym said: |
@retronym said: |
I use spring mvc to create the controllers.
Every thing is ok, but some parameters have been rename after compile in somes method of my controllers.
I found that in debug mode of idea
the
driverId
is rename todriverId$1
, So I cannot receive the value from spring mvc.Here's a minimal reproduction by Jason Zaugg:
The text was updated successfully, but these errors were encountered: