scalagwt/scalagwt-scala — Issue #38: Wrong variable names in try..catch statement of jribble output
Author: gkossakowski
Created: 2011-10-11 19:24:10+00:00
State: open

Following code snippet:

```
def catchAndPassToLambda {
try { true } catch { case ex: Exception => val f = () => ex }
}
```

results in jribble output where variable holding exception is named `ex` but referenced as `ex$2`. See below:

```
member {
type: Method
modifiers {
isPublic: true
}
method {
name: "catchAndPassToLambda"
returnType {
type: Void
}
body {
type: Block
block {
statement {
type: Try
tryStat {
block {
type: Block
block {
}
}
catch {
tpe {
pkg: "java.lang"
name: "Exception"
}
param: "ex"
body {
type: Block
block {
statement {
type: VarDef
varDef {
tpe {
type: Named
namedType {
pkg: "scala"
name: "Function0"
}
}
name: "f"
initializer {
type: NewObject
newObject {
clazz {
name: "Try$$anonfun$1"
}
signature {
name: "new"
owner {
name: "Try$$anonfun$1"
}
paramType {
type: Named
namedType {
name: "Try"
}
}
paramType {
type: Named
namedType {
pkg: "java.lang"
name: "Exception"
}
}
returnType {
type: Named
namedType {
name: "Try$$anonfun$1"
}
}
}
argument {
type: ThisRef
}
argument {
type: VarRef
varRef {
name: "ex$2"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
```