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

warn on implicit def without explicit result type

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: Scala 2.9.1
    • Fix Version/s: 2.12.0-M1
    • Component/s: Misc Compiler
    • Environment:

      Windows 7, it happens on SBT compile as well as with a ScalaIDE (2.0.0 RC2)

      Description

      The following code snipet : https://gist.github.com/1427587
      does not compile.

      import java.util.Date
      
      trait TDate 
      
      trait TT[A1,T1]
      
      trait TTFactory[F,G] {
        def create(f: F) : TT[F,G]
        def sample: F
      }
      
      object Impls {
      
        // If the c1 is declared before c2, it compiles fine
        // or if the implicit's result type is specified explicitly
        implicit def c2(s: Date)/* : TT[Date, TDate] */ = c1.create(s)  
      
        implicit val c1 = new TTFactory[Date,TDate] {
          def create(v: Date): TT[Date,TDate] = sys.error("")
          def sample = new Date
        }
      }
      

        Issue Links

          Activity

          Hide
          Adriaan Moors added a comment -

          see SI-2206, SI-801 and a plethora of duplicates

          Show
          Adriaan Moors added a comment - see SI-2206 , SI-801 and a plethora of duplicates
          Hide
          Adriaan Moors added a comment -

          warn unless enabled by feature flag

          Show
          Adriaan Moors added a comment - warn unless enabled by feature flag
          Hide
          Adriaan Moors added a comment -

          Unassigning and rescheduling to M6 as previous deadline was missed.

          Show
          Adriaan Moors added a comment - Unassigning and rescheduling to M6 as previous deadline was missed.

            People

            • Assignee:
              Unassigned
              Reporter:
              maxime.levesque
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:

                Development