Created
April 4, 2025 13:48
-
-
Save majk-p/06639b0d98f0bb88b60b1ba3355a95ff to your computer and use it in GitHub Desktop.
[fix] Found A => A instead of missing given instance - fixed by chaning order of givens
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 | |
| streamArnFor: StreamArnFor[EventType], | |
| withIsTest: EventType => { val isTest: Boolean }, | |
| ): 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