From 936c4381e975f0e2371a31fd765f04f5ceecf099 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 23 Feb 2019 18:51:18 +0100 Subject: [PATCH] Fix #5978: Add regression test --- tests/pos/i5978.scala | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/pos/i5978.scala diff --git a/tests/pos/i5978.scala b/tests/pos/i5978.scala new file mode 100644 index 000000000000..ee800e8ba902 --- /dev/null +++ b/tests/pos/i5978.scala @@ -0,0 +1,30 @@ +import scala.language.implicitConversions + +opaque type Position[Buffer] = Int + +trait TokenParser[Token, R] + +object TextParser { + implied TP for TokenParser[Char, Position[CharSequence]] {} + + implied FromCharToken + given (T: TokenParser[Char, Position[CharSequence]]) for Conversion[Char, Position[CharSequence]] = ??? +} + + +object Testcase { + def main(args: Array[String]): Unit = { + import TextParser._ + import implied TextParser._ + + val tp_v: TokenParser[Char, Position[CharSequence]] = TextParser.TP + val tp_i = the[TokenParser[Char, Position[CharSequence]]] + val co_i = the[Conversion[Char, Position[CharSequence]]] + val co_x : Position[CharSequence] = 'x' + + { + implied XXX for Conversion[Char, Position[CharSequence]] = co_i + val co_y : Position[CharSequence] = 'x' + } + } +} \ No newline at end of file