Scala Compiler Implicit Parameter Precedence

The compiler doesn’t randomly look for implicits in your code; it follows the following precedence:

  1. Locally declared implicits
  2. Imported implicits
  3. Outer scope (ex- a class for a method)
  4. Inheritance
  5. Package object
  6. Implicit scope like companion objects

Source: Top 30 Scala Interview Questions