From 1e7bf82006f6e05659ed8a2763d80d8c79e1c9d3 Mon Sep 17 00:00:00 2001 From: Julien Richard-Foy Date: Tue, 6 Jun 2023 15:53:42 +0200 Subject: [PATCH] Add failing test for #9685 --- tests/neg-macros/i9685bis.check | 9 +++++++++ tests/neg-macros/i9685bis.scala | 23 +++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 tests/neg-macros/i9685bis.check create mode 100644 tests/neg-macros/i9685bis.scala diff --git a/tests/neg-macros/i9685bis.check b/tests/neg-macros/i9685bis.check new file mode 100644 index 000000000000..45e7f85aa30d --- /dev/null +++ b/tests/neg-macros/i9685bis.check @@ -0,0 +1,9 @@ +-- [E008] Not Found Error: tests/neg-macros/i9685bis.scala:23:4 -------------------------------------------------------- +23 | 1.asdf // error + | ^^^^^^ + | value asdf is not a member of Int, but could be made available as an extension method. + | + | The following import might make progress towards fixing the problem: + | + | import foo.Baz.toBaz + | diff --git a/tests/neg-macros/i9685bis.scala b/tests/neg-macros/i9685bis.scala new file mode 100644 index 000000000000..0023d4d719b4 --- /dev/null +++ b/tests/neg-macros/i9685bis.scala @@ -0,0 +1,23 @@ +package foo + +import scala.language.implicitConversions + +class Foo + +object Foo: + + inline implicit def toFoo(x: Int): Foo = Foo() + +class Bar + +object Bar: + inline given Conversion[Int, Bar] with + def apply(x: Int): Bar = Bar() + +class Baz + +object Baz: + transparent inline implicit def toBaz(x: Int): Baz = Baz() + +object Usage: + 1.asdf // error