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

Refactored to enable compiling the library with strict compilation flags #305

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

NicolasRouquette
Copy link

Fixes #304

I use the leon library in another project where I compile it with these settings:

scalacOptions ++= Seq(
  "-deprecation",
  "-encoding", "UTF-8",     // yes, this is 2 args
  "-feature",
  "-language:existentials",
  "-language:higherKinds",
  "-language:implicitConversions",
  "-unchecked",
  "-Xfatal-warnings",
  "-Xlint",
  "-Yno-adapted-args",
  "-Ywarn-dead-code",       // N.B. doesn't work well with the ??? hole
  "-Ywarn-numeric-widen",
  "-Ywarn-value-discard",
  "-Xfuture",
  "-Ywarn-unused-import",   // 2.11 only
  "-Yno-imports"            // no automatic imports at all; all symbols must be imported explicitly
)

Most of the refactoring is to due to moving classes and objects that were defined in a package object file to a separate compilation unit.

I was surprised that -Yno-imports helps readability of the library where an unqualified type name could be misunderstood to refer to a type in leon's library instead of the scala library. For example, in leon.lang.Bag, the unqualified List type needs to refer to scala.collection.immutable.List instead of leon.collection.List.

@NicolasRouquette
Copy link
Author

The leon library was compiled with Artima's Supersafe with the following settings:

version 1
# See http://www.artima.com/supersafe_user_guide.html

# http://www.artima.com/supersafe_user_guide.html#array-comparison
# prevent nested array

# http://www.artima.com/supersafe_user_guide.html#preventing-a-type-from-being-used-in-comparison
prevent comparison Any nested

# http://www.artima.com/supersafe_user_guide.html#prevent-suspicious-inferred-type
prevent suspicious inferred type

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

Successfully merging this pull request may close these issues.

1 participant