Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
googley42 committed Sep 20, 2024
1 parent edba186 commit 062f517
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions dynamodb/src/it/scala/zio/dynamodb/TypeSafeApiNarrowSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ object TypeSafeApiNarrowSpec extends DynamoDBLocalSpec {
val invoice: dynamo.Invoice = dynamo.Invoice.Paid("1", 1)
val valid = DynamoDBQuery.narrow[dynamo.Invoice, dynamo.Invoice.Paid](invoice)
val invalid = DynamoDBQuery.narrow[dynamo.Invoice, dynamo.Invoice.Unpaid](invoice)
// gives expected compile error:
// type arguments [zio.dynamodb.TypeSafeApiNarrowSpec.dynamo.Invoice,zio.dynamodb.TypeSafeApiNarrowSpec.dynamo.Invoice.Unrelated] do not conform to method narrow's type parameter bounds [From,To <: From]bloop
// val unrelated = DynamoDBQuery.narrow[dynamo.Invoice, dynamo.Invoice.Unrelated](Unrelated(1))

// gives expected compile error:
// could not find implicit value for evidence parameter of type zio.schema.Schema.Enum[zio.dynamodb.TypeSafeApiNarrowSpec.dynamo.Invoice.Unrelated]bloop
// val x = DynamoDBQuery.narrow[dynamo.Invoice.Unrelated, dynamo.Invoice.Unrelated](Unrelated(1))
// gives expected compile error:
// type arguments [zio.dynamodb.TypeSafeApiNarrowSpec.dynamo.Invoice,zio.dynamodb.TypeSafeApiNarrowSpec.dynamo.Invoice.Unrelated] do not conform to method narrow's type parameter bounds [From,To <: From]
// val unrelated = DynamoDBQuery.narrow[dynamo.Invoice, dynamo.Invoice.Unrelated](Unrelated(1))

// gives expected compile error:
// could not find implicit value for evidence parameter of type zio.schema.Schema.Enum[zio.dynamodb.TypeSafeApiNarrowSpec.dynamo.Invoice.Unrelated]
// val x = DynamoDBQuery.narrow[dynamo.Invoice.Unrelated, dynamo.Invoice.Unrelated](Unrelated(1))

assert(valid)(isRight) && assert(invalid)(isLeft)
}
Expand Down

0 comments on commit 062f517

Please sign in to comment.