File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
compiler/src/dotty/tools/dotc/transform
tests/generic-java-signatures Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -291,7 +291,7 @@ object GenericSignatures {
291291
292292 case PolyType (tparams, mtpe : MethodType ) =>
293293 assert(tparams.nonEmpty)
294- if (toplevel) polyParamSig(tparams)
294+ if (toplevel && ! sym0.isConstructor ) polyParamSig(tparams)
295295 jsig(mtpe)
296296
297297 // Nullary polymorphic method
Original file line number Diff line number Diff line change 1+ 0
2+
3+ public A1(X)
4+ 0
5+
6+ public A2(java.lang.Object)
Original file line number Diff line number Diff line change 1+ class A1 [X ](val x : X )
2+ class A2 [F [_]](val x : F [String ])
3+
4+ object Test {
5+ def test (clazz : Class [? ]): Unit = {
6+ val List (constructor) = clazz.getConstructors().toList
7+ println(constructor.getTypeParameters().length)
8+ println(constructor.getTypeParameters().mkString(" , " ))
9+ println(constructor.toGenericString())
10+ }
11+
12+ def main (args : Array [String ]): Unit = {
13+ test(classOf [A1 [? ]])
14+ test(classOf [A2 [? ]])
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments