Skip to content

add/strict #409

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

Merged
merged 1 commit into from
Mar 13, 2015
Merged

add/strict #409

merged 1 commit into from
Mar 13, 2015

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 13, 2015

Add -strict option to do some type checks that are encessary to ensure type soundness, but
are stricter than what Scala 2.x enforces.

The first such test is the "pattern cannot be uniquely instantiated" problem where we reject a
non-variant case subclass of a covariant superclass in a pattern match. The error is now only
issued in -struct mode, otherwise it will be a warning.

We might move more tests into the same category. This should help the transition. Review by @DarkDimius

Add -strict option to  do some type checks that are encessary to ensure type soundness, but
are stricter than what Scala 2.x enforces.

The first such test is the "pattern cannot be uniquely instantiated" problem where we reject a
non-variant case subclass of a covariant superclass in a pattern match. The error is now only
issued in -struct mode, otherwise it will be a warning.

We might move more tests into the same category. This should help the transition.
@@ -39,6 +39,7 @@ class ScalaSettings extends Settings.SettingGroup {
val defines = PrefixSetting("-Dproperty=value", "-D", "Pass -Dproperty=value directly to the runtime system.")
val toolcp = PathSetting("-toolcp", "Add to the runner classpath.", "")
val nobootcp = BooleanSetting("-nobootcp", "Do not use the boot classpath for the scala jars.")
val strict = BooleanSetting("-strict", "Use strict type rules, which means some formerly legal code does not typecheck anymore.")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a document that describes what Scala code can be used with Dotty without any changes and what requires migration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet. I think we should work one having one though.

@smarter
Copy link
Member

smarter commented Mar 13, 2015

Shouldn't we run the tests with -strict?

@DarkDimius
Copy link
Contributor

Codewise LGTM,
But, @odersky, what should be the default?
Does this mean that we want to be unsoundness-compatible with scala?
I'd better say that there should flag that allows to be unsound, not the one that enables soundness.

@odersky
Copy link
Contributor Author

odersky commented Mar 13, 2015

For the moment I would prioritize scala compatibility, also for the tests. Once we have everything under dotty we can selectively enforce -strict.

DarkDimius added a commit that referenced this pull request Mar 13, 2015
@DarkDimius DarkDimius merged commit d34a511 into scala:master Mar 13, 2015
@allanrenucci allanrenucci deleted the add/strict branch December 14, 2017 16:58
tgodzik added a commit to tgodzik/scala3 that referenced this pull request May 27, 2025
Backport "Remove premature caching of lookups for unused lint" to 3.3 LTS
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.

4 participants