summaryrefslogtreecommitdiff
path: root/test/files/neg/nullary-override.check
Commit message (Collapse)AuthorAgeFilesLines
* Made -Xfatal-warnings less immediately fatal.Paul Phillips2012-08-101-1/+3
| | | | | | | Instead of changing warnings to errors mid-stream, at the end of a run I check for condition "no errors, some warnings, and fatal warnings" and then generate an error at that point. This is necessary to test for some warnings which come from later stages.
* Warning! Warning! Yes, that's what's in this co...Paul Phillips2011-06-291-0/+4
Warning! Warning! Yes, that's what's in this commit. Why are you panicking? Mostly new command line options: -Xlint // basically, the ones which aren't noisy Ywarn-all -Ywarn-dead-code Ywarn-inaccessible // try this one on the library: -it makes some good points Ywarn-nullary-override Ywarn-nullary-unit -Ywarn-numeric-widen Ywarn-value-discard Some accumulated motivations: The wontfix resolution of ticket #4506 indicates that "def foo" and "def foo()" are always going to be treated differently in some situations and the same in others without users having any way to fix it. Summary expressed in latest comment with which I agree (and quite sadly, given that I've done a lot of work to try to make them usable) is "avoid using structural types like the plague." But the least we can do is warn if you're using parentheses "wrong". I think it would be better if the warning about "def foo()" overriding "def foo" were an error instead. If we have to live with this... trait Me { def f(): Int } class A { def f: Int = 5 } class C extends A with Me { } // error: Int does not take parameters def f(x: C) = x.f() // compiles def f(x: Me) = x.f() // error: Int does not take parameters. Mmph, how can a method be // legal with parameter "Foo" and illegal with parameter "Foo with // Bar" ? def f(x: Me with C) = x.f() The warning about a method contains a reference to a type which is less accessible than the method itself is obviously to those who recall it a response to GenTraversable being private and appearing in flatMap's signature during the 2.9.0 RCs. It avoids warning in the case where the unnormalized type is inaccessible but the normalized version would be, but it could use further refinement.