Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/scala.annotation/implicitAmbiguous

implicitAmbiguous

scala.annotation.implicitAmbiguous

To customize the error message that's emitted when an implicit search finds multiple ambiguous values, annotate at least one of the implicit values@implicitAmbiguous. Assuming the implicit value is a method with type parametersX1,..., XN, the error message will be the result of replacing all occurrences of${Xi} in the stringmsg with the string representation of the corresponding type argumentTi.

If more than one@implicitAmbiguous annotation is collected, the compiler is free to pick any of them to display.

Nice errors can direct users to fix imports or even tell them why code intentionally doesn't compile.

trait =!=[C, D]implicit def neq[E, F] : E =!= F = null@annotation.implicitAmbiguous("Could not prove ${J} =!= ${J}")implicit def neqAmbig1[G, H, J] : J =!= J = nullimplicit def neqAmbig2[I] : I =!= I = nullimplicitly[Int =!= Int]

Attributes

Source
implicitAmbiguous.scala
Graph
Supertypes
classObject
traitMatchable
classAny
Show all
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp