File tree 3 files changed +18
-2
lines changed
compiler/src/dotty/tools/dotc/transform
tests/generic-java-signatures
3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -239,8 +239,8 @@ object GenericSignatures {
239
239
methodResultSig(restpe)
240
240
241
241
case mtpe : MethodType =>
242
- // phantom method parameters do not make it to the bytecode.
243
- val params = mtpe.paramInfos.filterNot(_.isPhantom)
242
+ // unused method parameters do not make it to the bytecode.
243
+ val params = if (mtpe.isUnusedMethod) Nil else mtpe.paramInfos.filterNot(_.isPhantom)
244
244
val restpe = mtpe.resultType
245
245
builder.append('(' )
246
246
// TODO: Update once we support varargs
Original file line number Diff line number Diff line change
1
+ public <U> int MyUnused$.f1()
2
+ U <: java.lang.Object
Original file line number Diff line number Diff line change
1
+ object MyUnused {
2
+ def f1 [U ](unused a : Int ): Int = 0
3
+ }
4
+
5
+ object Test {
6
+ def main (args : Array [String ]): Unit = {
7
+ val f1 = MyUnused .getClass.getMethods.find(_.getName.endsWith(" f1" )).get
8
+ val tParams = f1.getTypeParameters
9
+ println(f1.toGenericString)
10
+ tParams.foreach { tp =>
11
+ println(tp.getName + " <: " + tp.getBounds.map(_.getTypeName).mkString(" , " ))
12
+ }
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments