Skip to content

implicitNotFound annotations on parameters are lost through export #20127

Closed
@natsukagami

Description

@natsukagami

Compiler version

3.3.2, 3.4.1, latest main (20ae563)

Minimized code

import scala.annotation.*

trait X

object Foo:
  def foo(using @implicitNotFound("foo!") x: X) = "foo"

object FooClone:
  export Foo.foo
  
object Main:
  val n = 10
  Foo.foo
  FooClone.foo

Output

-- [E172] Type Error: Test.scala:13:9 ------------------------------------------
13 |  Foo.foo
   |         ^
   |         foo!
-- [E172] Type Error: Test.scala:14:14 -----------------------------------------
14 |  FooClone.foo
   |              ^
   |No given instance of type X was found for parameter x of method foo in object FooClone

Note that the FooClone.foo call no longer emits the custom error message "foo!".

Expectation

Calling FooClone.foo should properly give the custom error message.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions