Skip to content

Instantly share code, notes, and snippets.

View matwojcik's full-sized avatar

Mateusz Wójcik matwojcik

View GitHub Profile
@matwojcik
matwojcik / Unused213.scala
Last active December 14, 2023 10:20
Scala213 Compatible version of Unused.scala
object Test {
def fn1(x: Int, y: Int = 5)(z: Int) = Some(x+y+z)
def fn2(x: Int)(y: Int) = Some(x+y)
def program = {
fn1(4) // why this compiles
fn2(2) // when this does not
5
}
}
@matwojcik
matwojcik / Unused.scala
Last active December 14, 2023 10:21
Scala3 Eta Expansion Bug
def fn1(x: Int, y: Int = 5)(z: Int) = Some(x+y+z)
def fn2(x: Int)(y: Int) = Some(x+y)
def program =
fn1(4) // why this compiles
fn2(2) // when this does not
5