Suppression of “parameterized overloaded implicit methods not displayed as view boundaries” in Scala

Is it possible to suppress this particular warning with @SuppressWarnings(???)? (I do not intend to use this transformation as a view constraint, so a warning is not useful.)

+5
source share
2 answers

Unfortunately no. The compiler ignores @SuppressWarnings. Also see this question .

+6
source

@SuppressWarnings, , . , , ( ) , .

, , , :

class MyClass
object MyClass {
   implicit def myConv: MyClass = error("TODO")
   implicit def myConv[X](value: X): MyClass = error("TODO")
}

:

class MyClass
object MyClass {
   implicit def myConv: MyClass = error("TODO")
   def myConv[X](value: X): MyClass = error("TODO") // made it non implicit
   implicit def myConv2[X](value: X): MyClass = myConv( value ) // renamed so that it is not an overload anymore
}

, scala 2.9.x, scala 2.10 ( , , - - , ).

+1

All Articles