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

Investigate errors printed to stdout on test compile #26

Open
zainab-ali opened this issue Jun 7, 2017 · 2 comments
Open

Investigate errors printed to stdout on test compile #26

zainab-ali opened this issue Jun 7, 2017 · 2 comments

Comments

@zainab-ali
Copy link
Contributor

Errors are printed to stdout during test compile. The code compiles successfully and all tests pass, so these errors are not critical. It would be worth investigating which compilation step is causing this.

<console>:17: error: identifier expected but integer literal found.
  type QuantityOf[A, D, U <: Unit[D]] = Quantity[A, Term[D, U, Fraction[1, 1]] :: HNil]
                                                                        ^
<console>:18: error: ']' expected but '}' found.
}
^
<console>:119: error: identifier expected but integer literal found.
      implicit ev0: fraction.Multiply.Aux[F, Fraction[P, 1], PF],
                                                         ^
<console>:133: error: ']' expected but '}' found.
  }
  ^
<console>:148: error: identifier expected but integer literal found.
      implicit ev0: fraction.Multiply.Aux[F, Fraction[1, P], PF],
                                                      ^
<console>:162: error: ']' expected but '}' found.
  }
  ^
<console>:205: error: identifier expected but integer literal found.
      ev0: Require[FD != 1],
                         ^
<console>:228: error: ']' expected but '}' found.
  }
  ^
@lewismj
Copy link

lewismj commented Nov 10, 2017

I'm not sure if this is the same thing, but I think Spire 'fixes' this with some macros:
https://github.com/non/spire/blob/master/core/shared/src/main/scala/spire/macros/Macros.scala
I guess that would be a trade-off between some spurious test compilation messages and what looks like a hefty bit of boilerplate?

@zainab-ali
Copy link
Contributor Author

Thanks for prompting me to look into this @lewismj !

The errors are caused by the doctest plugin. I think it isn't picking up the Typelevel Scala compiler when parsing the tests, thus printing compile errors. The tests get generated successfully anyhow, and are run with Typelevel Scala, so there are no major problems.

I'll take a deep dive into this a bit later and find out if spire's macros are indeed the solution. It might be better to see if there's a flag I could set for doctest.

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

2 participants