From 291d1f033a790e97298210de29f09a9796406ae3 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Sun, 23 Sep 2012 18:58:50 +0200 Subject: SI-6412 fixes leaks in Types.uniques This is the most blatant leak in reflection. There are others, but their impact is much smaller, therefore we'll fix them later, after 2.10.0-final. For more information, see https://issues.scala-lang.org/browse/SI-6412 and http://groups.google.com/group/scala-internals/browse_thread/thread/eabcf3d406dab8b2 --- test/files/run/reflection-mem-glbs.scala | 13 +++++++++++++ test/files/run/reflection-mem-tags.scala | 17 +++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test/files/run/reflection-mem-glbs.scala create mode 100644 test/files/run/reflection-mem-tags.scala (limited to 'test/files/run') diff --git a/test/files/run/reflection-mem-glbs.scala b/test/files/run/reflection-mem-glbs.scala new file mode 100644 index 0000000000..3f29a914bc --- /dev/null +++ b/test/files/run/reflection-mem-glbs.scala @@ -0,0 +1,13 @@ +import scala.tools.partest.MemoryTest + +trait A { type T <: A } +trait B { type T <: B } + +object Test extends MemoryTest { + override def maxDelta = 10 + override def calcsPerIter = 50000 + override def calc() { + import scala.reflect.runtime.universe._ + glb(List(typeOf[A], typeOf[B])) + } +} \ No newline at end of file diff --git a/test/files/run/reflection-mem-tags.scala b/test/files/run/reflection-mem-tags.scala new file mode 100644 index 0000000000..8815e7dcd8 --- /dev/null +++ b/test/files/run/reflection-mem-tags.scala @@ -0,0 +1,17 @@ +import scala.tools.partest.MemoryTest + +trait A { type T <: A } +trait B { type T <: B } + +object Test extends MemoryTest { + override def maxDelta = 10 + override def calcsPerIter = 100000 + override def calc() { + import scala.reflect.runtime.universe._ + def foo = { + class A { def x = 2; def y: A = new A } + weakTypeOf[A { def z: Int }] + } + foo + } +} \ No newline at end of file -- cgit v1.2.3