Skip to content

Uninitialized field on creating implicit val for ContextShift using TestContext #798

Description

@arbitrary-dev

Reproduction

scala> :paste
// Entering paste mode (ctrl-D to finish)

import cats.effect._
import cats.effect.laws.util.TestContext

implicit val ec: TestContext = TestContext()
implicit val cs: ContextShift[IO] = ec.contextShift[IO]

// Exiting paste mode, now interpreting.

scala.UninitializedFieldError: Uninitialized field: <pastie>: 15
  at .cs(<pastie>:15)
  ... 44 elided

Not implicit

scala> :paste
// Entering paste mode (ctrl-D to finish)

import cats.effect._
import cats.effect.laws.util.TestContext

implicit val ec: TestContext = TestContext()
val cs: ContextShift[IO] = ec.contextShift[IO]

// Exiting paste mode, now interpreting.

import cats.effect._
import cats.effect.laws.util.TestContext
ec: cats.effect.laws.util.TestContext = cats.effect.laws.util.TestContext@77ec71c0
cs: cats.effect.ContextShift[cats.effect.IO] = cats.effect.laws.util.TestContext$$anon$4@566ea66

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions