Skip to content

Instantly share code, notes, and snippets.

@soc
Created October 21, 2011 15:54
Show Gist options
  • Save soc/1304183 to your computer and use it in GitHub Desktop.
Save soc/1304183 to your computer and use it in GitHub Desktop.
object UnitsTest extends App {
import metascala.Units._
val length1 = m(23)
val length2 = m(17)
val area: Area = length1 * length2 // Works, Quantity[_2, _0]
val time = s(42)
val foo: Foo = time * length1 // Works, Quantity[_1, _1]
//val speed: Speed = length1 / time // Doesn't work, Quantity[_1, _1#Neg]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment