Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List order makes types different #3

Open
ppiotrow opened this issue May 3, 2016 · 0 comments
Open

List order makes types different #3

ppiotrow opened this issue May 3, 2016 · 0 comments

Comments

@ppiotrow
Copy link
Owner

ppiotrow commented May 3, 2016

The same values in HList (Nominator or Denominator) makes different types if they are present in different order(eg. Kilogram :: Meter is not Meter :: Kilogram)

object Foo {
  import UnitSupport._
  type Momentum = Units[Kilogram :: Meter :: HNil, Second :: HNil]
  object Momentum extends ComplexUnit[Kilogram :: Meter :: HNil, Second :: HNil]

  type MomentumAlias = Units[Meter :: Kilogram :: HNil, Second :: HNil]
  object MomentumAlias extends ComplexUnit[Meter :: Kilogram :: HNil, Second :: HNil]

  val momentum: MomentumAlias = 1.as(Momentum) //will not compile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant