Skip to content

Instantly share code, notes, and snippets.

@uarun
Last active December 9, 2015 20:39
Show Gist options
  • Save uarun/4325437 to your computer and use it in GitHub Desktop.
Save uarun/4325437 to your computer and use it in GitHub Desktop.
Useful scalac options (for scala 2.10)

Useful Scalac Options

-encoding "UTF-8"

-target:jvm-1.6

Uses the ASM Compiler backend to generate bytecode (Scala 2.10)

-deprecation

-feature

Activates checking of SIP-18 features, forces import language.

-unchecked

Enable detailed unchecked warnings (prevents accidental usage of erased types)

-Xlog-reflective-calls

Prints a message when a reflective call is generated

  • Method invocations on structural types
  • Allows you to spot where structure types are used/inferred

-Ywarn-adapted-args

Warns if an argument list is modified to match the receiver

For example: fn(x: Int, y: Int) changed to fn(x: Any) the compiler could force the (incorrect) 2 argument call to fn(x: Tuple2[Int, Int])

Credit

Copied from Victor Klang's (@victorklang) Scala Exchange 2012 talk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment