Questions tagged [scalac]

scalac - Compiler for the Scala 2 language

176 questions
1
vote
1 answer

Cannot run a scala script (fpmax by jdegoes)

Here's a brilliant web talk by J. A. De Goes: https://www.youtube.com/watch?v=sxudIMiOo68 - highly recommended for everyone interested in functional programming And here's accompanying code…
Vasily802
  • 1,703
  • 2
  • 18
  • 35
1
vote
1 answer

Scala AST avoid traversal of Tree children

I am working on a scalac plugin in which I am traversing the AST. Right now I am using a for each loop over the unit.body, which I get from the passed Global value. The issue I am facing is that due to the recursive nature of said for each…
MrDeal
  • 373
  • 2
  • 11
1
vote
2 answers

While parsing annotations could not find MAYBE in enum . Scala + Micrometer

While trying to use micrometer on a Scala project, I got this warning: [error] While parsing annotations in /Users/vargasmontero/.ivy2/cache/io.micrometer/micrometer-core/jars/micrometer-core-1.0.4.jar(io/micrometer/core/lang/Nullable.class), could…
cvargascr
  • 103
  • 8
1
vote
2 answers

Why does this function parameter need double braces on a tuple?

Note: I am using scalac. Please do not recommend to use sbt instead. I ran into a peculiar issue that I could resolve, but I am wondering why it works that way and not the way I did it before. Here's a code snippet: def multiply[A](r1: Vector[A],…
Markus Appel
  • 3,138
  • 1
  • 17
  • 46
1
vote
1 answer

Scalac option Yopt-log-inline make errors

With scala 2.12.4 when I use theses parameters scalacOptions := Seq("-unchecked", "-deprecation", "-opt:l:inline","-opt-inline-from:bfd.DateTime$","-Yopt-log-inline") I have error which doesn't exist when I don't use "-Yopt-log-inline" [info]…
crak
  • 1,635
  • 2
  • 17
  • 33
1
vote
1 answer

scala actually suppress compiler warnings

how can I actually suppress the compiler warning for: discarded non-Unit value [warn] kryo.register(classOf[Foo]) The suggestion of Suppress "discarded non-Unit value" warning does not apply since the problem takes place outside of my own…
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
1
vote
0 answers

Inspecting code with Scalac (v12.2.3) - error: macro annotation could not be expanded

Note - I have seen other posts on scala macro expansion on Stackoverflow, and most solutions concentrate around use of SBT. I'd like to solve it using scalac as well, to inspect the generated code. Hence posting a question that is similar and…
ganaakruti
  • 23
  • 4
1
vote
0 answers

Unclear warnings when enabled -XPrint:typer

While trying to clarify implicit conversions in my project I've enabled -XPrint:typer compiler option. As a result I got lot of warnings listed, some of them quite clear but a bunch is not clear at all. Example of the full warning output for such…
Alexander Arendar
  • 3,365
  • 2
  • 26
  • 38
1
vote
0 answers

Compile error for @elidable function with interpolated string as default argument

I'd like to write my own assert like: import scala.annotation.elidable object Util { // doesn't matter if true or false def someCondition(checking: Any): Boolean = false @elidable(elidable.ASSERTION) def assertSomething(checking: Any)( …
Sascha Kolberg
  • 7,092
  • 1
  • 31
  • 37
1
vote
0 answers

scalac plugin : how to get it working after typer phase with a missing jar

I'm currently trying to build a plugin that visits the AST produced by Scala to run some rule checks. So far, it only pretty prints the AST to get an hand in. AFAK, this plugin may run after different phases, but I tried with those two : namer :…
Jeff
  • 11
  • 3
1
vote
0 answers

scalac: missing or invalid dependency detected while loading class file 'CassandraSession.class'

I've been developing in Javadsl with Maven, but I haven't been able to compile the project in my intellij 2016 since I added Scaladsl libraries. This is the error I am getting: Error:scalac: missing or invalid dependency detected while loading …
user8079
  • 163
  • 1
  • 9
1
vote
1 answer

Debug Scala compiler plugin in IntelliJ IDEA

I would like to write my compiler plugin for scalac, but I get a problem in early state in development because I cannot run and debug my code from IntelliJ IDEA. I use these tutorials for implementing a dummy plugin: Scalac plugin template An old…
1
vote
0 answers

Scala with java threads error: bad symbolic reference

I'm new to scala and trying to play with it. I created new threads to run a test, when compiling the code with thread.join I get compilation error: Error:scalac: bad symbolic reference. A signature in package.class refers to type compileTimeOnly in…
apolak
  • 141
  • 1
  • 14
1
vote
1 answer

Scalac import language error

I'm trying to compile the AtomicScala example: scalac AtomicTest.scala I get the error: AtomicTest.scala:9: error: not found: object language import language.implicitConversions._ ^ I'm a complete novice so any help is much appreciated. PS…
schoon
  • 2,858
  • 3
  • 46
  • 78
1
vote
0 answers

Analysis of compiled Scala classes

For a Hobby Project of mine which includes a Compiler I need to Analyse class Files generated by scalac. To be Specific I need to do the Following: Find the Generic Arguments of a Class inkl. Higher order Kinds Find Methods Anotated with a Specific…
Markus Knecht
  • 430
  • 4
  • 10