Skip to content

Instantly share code, notes, and snippets.

@nagat01
Created September 3, 2024 05:17
Show Gist options
  • Save nagat01/28bb42f4acfa42c2593e838c023bf3df to your computer and use it in GitHub Desktop.
Save nagat01/28bb42f4acfa42c2593e838c023bf3df to your computer and use it in GitHub Desktop.
class A
class B extends A
val f: B => A = new Function1[A, B]{
def apply(a: A): B = B()
}
val g: B => A = (a: A) => B()
@main def main =
println(f(B()))
println(g(B()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment