From 09f380dbda56abdfbdda0cab51bc7187eb70b516 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Wed, 9 May 2012 15:13:09 -0700 Subject: Fix an inference regression with this.type. Closes SI-5210. --- test/pending/pos/z1720.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/pending/pos/z1720.scala (limited to 'test/pending') diff --git a/test/pending/pos/z1720.scala b/test/pending/pos/z1720.scala new file mode 100644 index 0000000000..6050f3ff88 --- /dev/null +++ b/test/pending/pos/z1720.scala @@ -0,0 +1,16 @@ +package test + +class Thing { + def info: Info[this.type] = InfoRepository.getInfo(this) + def info2: Info[this.type] = { + def self: this.type = this + InfoRepository.getInfo(self) + } +} + +trait Info[T] +case class InfoImpl[T](thing: T) extends Info[T] + +object InfoRepository { + def getInfo(t: Thing): Info[t.type] = InfoImpl(t) +} \ No newline at end of file -- cgit v1.2.3