Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Adding support for compiler flags #17

Closed
nrinaudo opened this issue Feb 20, 2015 · 5 comments
Closed

Adding support for compiler flags #17

nrinaudo opened this issue Feb 20, 2015 · 5 comments
Milestone

Comments

@nrinaudo
Copy link

There doesn't seem to be a way to specify compiler options to tut.

This would for example be useful for cases like this:

trait Functor[F[_]] {
  def map[A, B](fa: F[A])(f: A => B): F[B]
}

This results in the following "noisy" output"

scala> trait Functor[F[_]] {
     |   def map[A, B](fa: F[A])(f: A => B): F[B]
     | }
warning: there was one feature warning; re-run with -feature for details
defined trait Functor

I realise that I can bring language.higherKinds in scope to disable the warning, but that just feels like adding some different kind of noise.

Also, there might very well be a way to do this that I missed, in which case I apologise for wasting your time.

@tpolecat tpolecat added the bug label Feb 20, 2015
@tpolecat
Copy link
Owner

Nope, that's a bug. I need to propagate the settings from scalacOptions in (Compile, doc) down into the nested interpreter. For now you can bring that thing into scope (or in this particular case just use tut:silent to discard the REPL noise altogether).

Thanks!

@tpolecat
Copy link
Owner

Also I just noticed that the README had 0.3.0 as the version in the snippet ... make sure you're using 0.3.1, it's much better.

@nrinaudo
Copy link
Author

I was actually already running 0.3.1 - I discovered tut while going through cats' code, and that already used the latest version.

I have another issue which might be related, but I'm not sbt-savvy enough to know for sure. Compiler plugins are not propagated either - in particular, I'm using kind-projector, but can't get tut to understand the type lambda syntax. Is it the same issue, or should I open a new ticket?

@tpolecat
Copy link
Owner

Yeah I ran into the KP issue as well. If you could file an issue that would be great. It may end up being the same problem but I'm not sure.

@tpolecat
Copy link
Owner

I looked at this over lunch and I seem to have a fix for both this and #18. Like everything with SBT it was confusing as hell but in the end it was just a few lines of code. I'll clean it up tonight and if all goes well I'll burn a new version this weekend.

Thanks again for the suggestions!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants