Skip to content

Commit

Permalink
Support ZLayer in NothingInContravariantPositionInspection (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
hmemcpy authored May 18, 2024
1 parent 397359f commit f703c61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/scala/zio/intellij/utils/TypeCheckUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object TypeCheckUtils {
val zioSpecTypes = List("zio.test.Spec", "zio.test.SpecVersionSpecific")
// ZStreams API signatures sometimes slightly differ from regular one (no `.tapBoth`, different `.tap`)
val zioLike_notStream = zioTypes ++ managedTypes ++ extraTypes ++ zioTestAsserts
val zioLikePackages = zioLike_notStream ++ zioStreamTypes
val zioLikePackages = zioLike_notStream ++ zioStreamTypes ++ zioLayerTypes

def fromZioLike(r: ScExpression): Boolean =
isOfClassFrom(r, zioLikePackages)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class NothingInContravariantPositionInspectionTest
def test_value_def(): Unit =
z(s"val foo: ZIO[${START}Nothing$END, Nothing, Unit] = ???").assertHighlighted()

def test_zlayer_def(): Unit =
z(s"val foo: ZLayer[${START}Nothing$END, Nothing, Unit] = ???").assertHighlighted()

def test_type_alias(): Unit =
z(s"type Test[+A] = ZIO[${START}Nothing$END, Nothing, A] = ???").assertHighlighted()

Expand Down

0 comments on commit f703c61

Please sign in to comment.