Skip to content

implicitNotFound annotations on parameters are lost through export #20127

Closed
@natsukagami

Description

@natsukagami
Contributor

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.

Activity

self-assigned this
on Apr 9, 2024
added
SpreeSuitable for a future Spree
and removed
stat:needs triageEvery issue needs to have an "area" and "itype" label
on Apr 9, 2024
hamzaremmal

hamzaremmal commented on Apr 9, 2024

@hamzaremmal
Member

We are currently working on this issue for the spree with @jan-pieter

added a commit that references this issue on Apr 9, 2024
2148c8d
added this to the 3.5.0 milestone on May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    Participants

    @natsukagami@Kordyjan@hamzaremmal

    Issue actions

      `implicitNotFound` annotations on parameters are lost through `export` · Issue #20127 · scala/scala3