Skip to content

SI-7294 Towards finality for TupleN#2299

Merged
paulp merged 3 commits intoscala:masterfrom
retronym:ticket/7294
Mar 25, 2013
Merged

SI-7294 Towards finality for TupleN#2299
paulp merged 3 commits intoscala:masterfrom
retronym:ticket/7294

Conversation

@retronym
Copy link
Member

  • Treat TupleN as final under -Xfuture for static analysis
  • Deprecate inheritance from TupleN.

Review by @lrytz @paulp (it's a change to a core class, so a few opinions are needed.)

@ghost ghost assigned lrytz Mar 24, 2013
@paulp
Copy link
Contributor

paulp commented Mar 24, 2013

@ijuma which are the too-noisy ones? I would like to move all the warning configuration into a config file and you can enable/disable them at will, it's just one of those tasks which is full of tedium.

@paulp
Copy link
Contributor

paulp commented Mar 24, 2013

LGTM other than the test case comment which mentions -Xlint (not that I think people are deriving a lot of knowledge from test case comments.)

@ijuma
Copy link
Contributor

ijuma commented Mar 24, 2013

-Ywarn-nullary-unit and -Ywarn-adapted-args are the two that are currently disabled (using 2.10.1). I tried hard to keep the second one, but it was problematic due to libraries that rely on it in their DSLs (both Squeryl and lift-json have the issue if I recall correctly).

@retronym
Copy link
Member Author

edited to s/lint/future/.

For the purposes of checkability warnings. This will
warn in case of:

	scala> (1, 2) match { case Seq() => 0; case _ => 1 }
	res9: Int = 1

Given how often Tuples are used as scrutinees, this is
a highly desirable place to warn.

I was orginally going to unlock this under -Xlint, and
could be easily convinced to go that way, given that
-Xfuture is a less popular option.
The motivation is to provide static warnings
in cases like:

    scala> (1, 2) match { case Seq() => 0; case _ => 1 }
    res9: Int = 1
@retronym
Copy link
Member Author

I agree, something as simple as a regex based warning filter would be really useful.

paulp added a commit that referenced this pull request Mar 25, 2013
SI-7294 Towards finality for TupleN
@paulp paulp merged commit 651bbdb into scala:master Mar 25, 2013
szeiger added a commit to szeiger/scala that referenced this pull request Jul 7, 2016
This includes undoing the special case for `-Xfuture` introduced in
scala#2299 and updating tests to take
the new errors into account.
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