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

docJar fails if code depends on scalac options #336

Closed
keynmol opened this issue May 18, 2018 · 0 comments
Closed

docJar fails if code depends on scalac options #336

keynmol opened this issue May 18, 2018 · 0 comments
Labels
solved The issue was fixed/resolved
Milestone

Comments

@keynmol
Copy link
Contributor

keynmol commented May 18, 2018

Simplest example:

core/src/Main.scala

import scala.collection.immutable.SortedMap

object Main extends App {
  def foo[F[_], A](fa: F[A]): String = fa.toString
  foo { x: Int => x * 2 }
}

build.sc

object core extends ScalaModule {
    def scalaVersion = "2.12.4"
    
    def scalacOptions = super.scalacOptions() ++ Seq(
    "-Ypartial-unification"
    )
}

This is because docJar doesn't pass plugin options to ScalaDoc call (compile passes):

error: no type parameters for method foo: (fa: F[A])String exist so that it can be applied to arguments (Int => Int)
 --- because ---
argument expression's type is not compatible with formal parameter type;
 found   : Int => Int
 required: ?F[?A]
  foo { x: Int => x * 2 }
  ^
...
warning: there was one feature warning; re-run with -feature for details
model contains 3 documentable templates
one warning found
two errors found
1 targets failed
foo.docJar ammonite.ops.InteractiveShelloutException
    mill.modules.Jvm$.subprocess(Jvm.scala:180)
    mill.scalalib.ScalaModule.$anonfun$docJar$2(ScalaModule.scala:119)
    mill.define.ApplyerGenerated.$anonfun$zipMap$3(ApplicativeGenerated.scala:9)
    mill.define.Task$MappedDest.evaluate(Task.scala:348)
keynmol pushed a commit to keynmol/mill that referenced this issue May 18, 2018
keynmol pushed a commit to keynmol/mill that referenced this issue May 18, 2018
@lefou lefou added this to the 0.2.1 milestone Apr 30, 2019
@lefou lefou added the solved The issue was fixed/resolved label Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved The issue was fixed/resolved
Projects
None yet
Development

No branches or pull requests

2 participants