aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/z1720.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-08-18 09:08:34 +0200
committerMartin Odersky <odersky@gmail.com>2016-08-18 10:10:01 +0200
commitf4ab855b03e9fc0fac31018bf9383220d2399697 (patch)
tree1ceae06e1b7b033cde52d8954640cdc66074220a /tests/pos/z1720.scala
parent5a5f9d7ed37ca6449ef61ee5e0f6fbf9731df795 (diff)
downloaddotty-f4ab855b03e9fc0fac31018bf9383220d2399697.tar.gz
dotty-f4ab855b03e9fc0fac31018bf9383220d2399697.tar.bz2
dotty-f4ab855b03e9fc0fac31018bf9383220d2399697.zip
Fixes in comparisons between singleton types
Needed to address problem shown by z1720.scala. Another fix to avoidance is needed to make it pass completely.
Diffstat (limited to 'tests/pos/z1720.scala')
-rw-r--r--tests/pos/z1720.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/pos/z1720.scala b/tests/pos/z1720.scala
new file mode 100644
index 000000000..7394d428c
--- /dev/null
+++ b/tests/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)
+}