Scala Programming Language
  1. Scala Programming Language
  2. SI-7047

'silent=false' is not working at c.inferImplicitValue

    Details

      Description

      It seems that c.inferImplicitValue is ignoring the silent property, because no exception is thrown when the implicit is not available:

      scala> import language.experimental.macros
      import language.experimental.macros
      
      scala> import reflect.macros.Context
      import reflect.macros.Context
      
      scala> def fImpl(c: Context): c.Expr[Unit] = {
           | import c.mirror._
           | import c.universe._
           | 
           | if (c.inferImplicitValue(typeOf[Int], false) == EmptyTree)
           |   c.abort(c.enclosingPosition, "silent=false is not working") 
           | 
           | reify( () )
           | }
      fImpl: (c: scala.reflect.macros.Context)c.Expr[Unit]
      
      scala> def f = macro fImpl
      f: Unit
      
      scala> f
      <console>:12: error: silent=false is not working
                    f
                    ^
      

        Activity

        Show
        Eugene Burmako added a comment - https://github.com/scala/scala/pull/2494
        Show
        Eugene Burmako added a comment - Fixed in https://github.com/scala/scala/commit/b4da864247ccaaee4f987fbf433b312e1d744a8f

          People

          • Assignee:
            Eugene Burmako
            Reporter:
            Jesús López González
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development