diff --git a/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/src/dotty/tools/dotc/core/tasty/TreePickler.scala index 58697c196b36..1793f3a1f9f1 100644 --- a/src/dotty/tools/dotc/core/tasty/TreePickler.scala +++ b/src/dotty/tools/dotc/core/tasty/TreePickler.scala @@ -311,6 +311,10 @@ class TreePickler(pickler: TastyPickler) { case tp: NamedType if tp.name.isShadowedName => tp.name case _ => name } + println("sel: " + tree) + println("sel.tpe: " + tree.tpe) + println("sel.tpe.widen: " + tree.tpe.widen) + println("sel.tpe.signature: " + tree.tpe.signature) val sig = tree.tpe.signature if (sig == Signature.NotAMethod) pickleName(realName) else pickleNameAndSig(realName, sig) diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala index 2b5b86be18e6..cf213033d16b 100644 --- a/test/dotc/tests.scala +++ b/test/dotc/tests.scala @@ -53,6 +53,7 @@ class tests extends CompilerTest { // This directory doesn't exist anymore // @Test def pickle_pickling = compileDir(coreDir, "pickling", testPickling) @Test def pickle_ast = compileDir(dotcDir, "ast", testPickling) + @Test def pickle_inf = compileFile(posDir, "pickleinf", testPickling) //@Test def pickle_core = compileDir(dotcDir, "core", testPickling, xerrors = 2) // two spurious comparison errors in Types and TypeOps diff --git a/tests/pos/pickleinf.scala b/tests/pos/pickleinf.scala new file mode 100644 index 000000000000..9132f1a17579 --- /dev/null +++ b/tests/pos/pickleinf.scala @@ -0,0 +1,9 @@ +class Bar[N] { + def bar(name: N, dummy: Int = 42): N = name +} + +object Test { + def test(): Unit = { + (new Bar).bar(10) + } +}