Example

def example =
  implicit val i = implicitly[Int]

Error

-- [E124] Cyclic Error: example.scala:2:29 -------------------------------------
2 |  implicit val i = implicitly[Int]
  |                             ^
  |value i needs result type because its right-hand side attempts implicit search
  |
  |The error occurred while trying to compute the signature of method example
  |  which required to type the right hand side of method example since no explicit type was given
  |  which required to compute the signature of value i
  |  which required to type the right hand side of value i since no explicit type was given
  |  which required to searching for an implicit argument of type Int
  |  which required to compute the signature of value i
  |
  | Run with both -explain-cyclic and -Ydebug-cyclic to see full stack trace.
  |-----------------------------------------------------------------------------
  | Explanation (enabled by `-explain`)
  |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  | The right hand-side of value i's definition requires an implicit search at the highlighted position.
  | To avoid this error, give `value i` an explicit type.
   -----------------------------------------------------------------------------

Solution

// Add an explicit result type to avoid the cyclic dependency
// and ensure the implicit is available from an outer scope
given Int = 42

def example =
  val i: Int = summon[Int]
  i