Open tgodzik opened 1 year ago
x
and y
in the minimized code also lack Param
flag. In 3.1.3 they didn't have it either, but back there they were methods, not values
scala-cli compile -Xprint:typer -Yprint-debug -Ydebug-flags lambdaArgs.worksheet.sc
lambdaArgs.worksheet.sc
:
List(1,2,3).zipWithIndex.map { (x, y) => x + 1}
Output:
scala.this.package.List.apply[scala.this.Int^(inf)](
[1,2,3 : scala.this.Int^]
).zipWithIndex.map[scala.this.Int^(inf)](
{
{
<method> <synthetic> <artifact> <touched> def $anonfun(
<param> <synthetic> <touched> x$1:
scala.this.Tuple2[scala.this.Int @uncheckedVariance,
scala.this.Int
]
(inf)
): scala.this.Int^(inf) =
{
<synthetic> <touched> val x: scala.this.Int(inf) = x$1._1
<synthetic> <touched> val y: scala.this.Int(inf) = x$1._2
{
x.+(1)
}
}
closure($anonfun)
}
}
)
So, if I understand correctly val x
and val y
parameters should not be <synthetic>
, is that right?
Note: in the current version of metals, I get the following autocomplete suggestions:
This includes x$1
which is synthetic. Is it expected?
Note: in the current version of metals, I get the following autocomplete suggestions:
This includes
x$1
which is synthetic. Is it expected?
It's not, but it does compile actually List(1,2,3).zipWithIndex.map { (x, y) => x$1}
is a correct statement. This is coming from the compiler.
So, if I understand correctly val x and val y parameters should not be
, is that right?
Ideally they wouldn't since those are real parameters defined by the user.
Compiler version
3.2.0
Minimized code
Output
x
is marked as Synthetic both in the definition and in usage, which makes metals not show it to the user. We filter out synthetic symbols, since it usually meant that the symbol doesn't exist in the code.Also the tree at
x
is a ValDef with a zero span, which means that we can't properly check ifnamePos
contains the current cursor position.Expectation
Neither x nor y is synthetic.
Anyone can point me to the change that caused it? It was working ok in
3.1.3