Scala-dev: Audit `-Xfuture` for 2.13

Created on 13 Feb 2018  路  4Comments  路  Source: scala/scala-dev

https://github.com/scala/bug/issues/10719 is an example where a settings.future check was left in place longer than it should have been

for 2.13, we should at least audit all such checks that remain in the codebase

and perhaps once that audit is complete we'll find we can eliminate -Xfuture entirely; I bet we will

this is really just a piece of #430, but it's a nice manageable piece for a volunteer to tackle

  • [x] Octal scape literal (https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala#L874-L876)
  • [x] View bounds (https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala#L2424-L2426)
  • [x] Procedure syntax (https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala#L2723-L2735)
  • [x] Adaptation of nullary method (https://github.com/scala/scala/blob/v2.13.0-M4/src/compiler/scala/tools/nsc/typechecker/Adaptations.scala#L71-L86)
  • [x] Unsound type for ident/literal patterns (https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala#L37-L65)
help-wanted

Most helpful comment

Here are some settings.future that I found.

Octal escape literal (has PR: https://github.com/scala/scala/pull/6324)

https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala#L874-L876

https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/reflect/FormatInterpolator.scala#L114-L118

scala> "\052"
<console>:12: warning: Octal escape literals are deprecated, use \u002a instead.
       "\052"
        ^
res0: String = *

Deprecated in 2.11. This should be removed in 2.13.

View bounds (has PR: https://github.com/scala/scala/pull/6500)

https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala#L2424-L2426

https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala#L2873-L2874

Deprecated under -Xfuture. Should be deprecated in 2.13, and removed under -Xsource:2.14.

Procedure syntax (has PR: https://github.com/scala/scala/pull/6325)

https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala#L2723-L2735

Deprecated under -Xfuture. Should be deprecated in 2.13, and removed under -Xsource:2.14.

Adaptation of nullary method (has PR: https://github.com/scala/scala/pull/6797)

https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/nsc/typechecker/Adaptations.scala#L71-L88

See SI-7187 deprecate eta-expansion of zero-arg method values and Fix #2570: Part 3 - The great () insert.
See also scala/scala#6475.

This should be removed in 2.13.

Unsound type for ident/literal patterns (has PR: https://github.com/scala/scala/pull/6502)

https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala#L37-L65

See SI-1503 don't assume unsound type for ident/literal patterns. Dotty currently has this test in pending https://github.com/lampepfl/dotty/blob/0.6.0-RC1/tests/pending/run/t1503.scala.

All 4 comments

Here are some settings.future that I found.

Octal escape literal (has PR: https://github.com/scala/scala/pull/6324)

https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala#L874-L876

https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/reflect/FormatInterpolator.scala#L114-L118

scala> "\052"
<console>:12: warning: Octal escape literals are deprecated, use \u002a instead.
       "\052"
        ^
res0: String = *

Deprecated in 2.11. This should be removed in 2.13.

View bounds (has PR: https://github.com/scala/scala/pull/6500)

https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala#L2424-L2426

https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala#L2873-L2874

Deprecated under -Xfuture. Should be deprecated in 2.13, and removed under -Xsource:2.14.

Procedure syntax (has PR: https://github.com/scala/scala/pull/6325)

https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala#L2723-L2735

Deprecated under -Xfuture. Should be deprecated in 2.13, and removed under -Xsource:2.14.

Adaptation of nullary method (has PR: https://github.com/scala/scala/pull/6797)

https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/nsc/typechecker/Adaptations.scala#L71-L88

See SI-7187 deprecate eta-expansion of zero-arg method values and Fix #2570: Part 3 - The great () insert.
See also scala/scala#6475.

This should be removed in 2.13.

Unsound type for ident/literal patterns (has PR: https://github.com/scala/scala/pull/6502)

https://github.com/scala/scala/blob/v2.13.0-M3/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala#L37-L65

See SI-1503 don't assume unsound type for ident/literal patterns. Dotty currently has this test in pending https://github.com/lampepfl/dotty/blob/0.6.0-RC1/tests/pending/run/t1503.scala.

Dotty currently has this test in pending https://github.com/lampepfl/dotty/blob/0.6.0-RC1/tests/pending/run/t1503.scala.

The test hasn't been moved out of pending but Dotty now has the same behavior as scalac -Xfuture (see https://github.com/lampepfl/dotty/pull/4022)

Could someone add a progress bar to the ticket? :-) I think we're close to done on this, right?

Done. scala/scala#6475 didn't remove setting.future, so I don't think it qualifies as "has PR".

Was this page helpful?
0 / 5 - 0 ratings