Created
April 4, 2025 13:47
-
-
Save majk-p/081f79021769b904cd8399a339bd6e94 to your computer and use it in GitHub Desktop.
Found A => A instead of missing given instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //> using scala 3.3.5 | |
| trait StreamArnFor[A] { | |
| val name: String | |
| } | |
| object api { | |
| def expect[ | |
| CompanionObject, | |
| EventType | |
| ]( | |
| eventTag: CompanionObject, | |
| partitionKey: Option[String] = None | |
| )( | |
| condition: EventType => Boolean | |
| )(using | |
| withIsTest: EventType => { val isTest: Boolean }, | |
| streamArnFor: StreamArnFor[EventType], | |
| ): Option[EventType] = ??? | |
| } | |
| case class MyEvent(id: String, isTest: Boolean) | |
| object MyEvent { | |
| val metadata = "some metadata" | |
| } | |
| @main | |
| def main() = { | |
| api.expect(MyEvent){ (event: MyEvent) => event.id.nonEmpty } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment