aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/t5643.scala
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2017-03-09 10:20:25 +0100
committerGitHub <noreply@github.com>2017-03-09 10:20:25 +0100
commit8e5c9c4a1a4555883307b7e81fea064134f350f2 (patch)
treee2feee0b87ed785e32ed8ba8fa2953128498f917 /tests/pos/t5643.scala
parent6abaa109e1add82f4add605a5cb3243e34b1ee33 (diff)
parentc7f1f35c36593ac9454c8572a59c649610829b6a (diff)
downloaddotty-8e5c9c4a1a4555883307b7e81fea064134f350f2.tar.gz
dotty-8e5c9c4a1a4555883307b7e81fea064134f350f2.tar.bz2
dotty-8e5c9c4a1a4555883307b7e81fea064134f350f2.zip
Merge pull request #2045 from dotty-staging/fix-hlist-hmap
Fix type inference for HLists and HMaps
Diffstat (limited to 'tests/pos/t5643.scala')
-rw-r--r--tests/pos/t5643.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/pos/t5643.scala b/tests/pos/t5643.scala
new file mode 100644
index 000000000..1ce34ba36
--- /dev/null
+++ b/tests/pos/t5643.scala
@@ -0,0 +1,19 @@
+object TupledEvidenceTest {
+
+ abstract class TupledEvidence[M[_], T0] { type T = T0 }
+
+ implicit def witnessTuple2[M[_], T1, T2](implicit ev1: M[T1], ev2: M[T2]):
+ TupledEvidence[M, (T1, T2)] { type T = (T1, T2) } = sys.error("")
+
+ class GetResult[T]
+
+ implicit val getString: GetResult[String] = new GetResult[String]
+
+ implicit def getTuple[T](implicit w: TupledEvidence[GetResult, T]): GetResult[w.T] = sys.error("")
+
+ def f[T : GetResult] = ""
+
+ f[(String,String)](getTuple[(String, String)])
+
+ f[(String,String)]
+}