summaryrefslogtreecommitdiff
path: root/src/interactive
Commit message (Collapse)AuthorAgeFilesLines
* Concision contribution.Paul Phillips2013-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | We have lots of core classes for which we need not go through the symbol to get the type: ObjectClass.tpe -> ObjectTpe AnyClass.tpe -> AnyTpe I updated everything to use the concise/direct version, and eliminated a bunch of noise where places were calling typeConstructor, erasedTypeRef, and other different-seeming methods only to always wind up with the same type they would have received from sym.tpe. There's only one Object type, before or after erasure, with or without type arguments. Calls to typeConstructor were especially damaging because (see previous commit) it had a tendency to cache a different type than the type one would find via other means. The two types would compare =:=, but possibly not == and definitely not eq. (I still don't understand what == is expected to do with types.)
* An attempt to make tests deterministic.Paul Phillips2013-05-192-1/+6
| | | | | | | | | | | The nondeterminism presently showing itself in presentation/implicit-member is a consequence of the presentation compiler tests relying on details of the behavior of toString calls. We need to stomp this out, but it will take a while. Based on the check file changes enclosed with this commit, this will suffice for the presentation compiler tests. A broader assault will have to take place, but not yet.
* SI-6815 untangle isStable and hasVolatileTypeAdriaan Moors2013-05-162-4/+4
| | | | | | | | | | | | | | | | | | | | | `Symbol::isStable` is now independent of `Symbol::hasVolatileType`, so that we can allow stable identifiers that are volatile in ident patterns. This split is validated by SI-6815 and the old logic in RefChecks, which seems to assume this independence, and thus I don't think ever worked: ``` if (member.isStable && !otherTp.isVolatile) { if (memberTp.isVolatile) overrideError("has a volatile type; cannot override a member with non-volatile type") ``` Introduces `admitsTypeSelection` and `isStableIdentifierPattern` in treeInfo, and uses them instead of duplicating that logic all over the place. Since volatility only matters in the context of type application, `isStableIdentifierPattern` is used to check patterns (resulting in `==` checks) and imports.
* Absolutized paths involving the scala package.Paul Phillips2013-05-033-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Confusing, now-it-happens now-it-doesn't mysteries lurk in the darkness. When scala packages are declared like this: package scala.collection.mutable Then paths relative to scala can easily be broken via the unlucky presence of an empty (or nonempty) directory. Example: // a.scala package scala.foo class Bar { new util.Random } % scalac ./a.scala % mkdir util % scalac ./a.scala ./a.scala:4: error: type Random is not a member of package util new util.Random ^ one error found There are two ways to play defense against this: - don't use relative paths; okay sometimes, less so others - don't "opt out" of the scala package This commit mostly pursues the latter, with occasional doses of the former. I created a scratch directory containing these empty directories: actors annotation ant api asm beans cmd collection compat concurrent control convert docutil dtd duration event factory forkjoin generic hashing immutable impl include internal io logging macros man1 matching math meta model mutable nsc parallel parsing partest persistent process pull ref reflect reify remote runtime scalap scheduler script swing sys text threadpool tools transform unchecked util xml I stopped when I could compile the main src directories even with all those empties on my classpath.
* Merge pull request #2483 from adriaanm/merge-2.10.xPaul Phillips2013-05-021-2/+4
|\ | | | | Merge 2.10.x
| * Merge 2.10.x into masterAdriaan Moors2013-05-021-2/+4
| | | | | | | | | | | | | | | | | | | | Conflicts: bincompat-forward.whitelist.conf src/compiler/scala/tools/nsc/matching/Patterns.scala src/compiler/scala/tools/nsc/transform/patmat/Logic.scala src/compiler/scala/tools/nsc/typechecker/Infer.scala src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala test/files/neg/t5663-badwarneq.check
* | More useful checkfile output in interactive tests.Paul Phillips2013-04-302-6/+6
| | | | | | | | | | | | I resisted the urge to fix "aksTypeCompletion" for as long as I possibly could. While I was there I threw in what seem to be like significant output improvements, but you tell me.
* | SI-7362, crash in presentation compiler.Paul Phillips2013-04-301-13/+11
| | | | | | | | Code by retronym, test by huitseeker, I just move stuff around.
* | SI-7291: No exception throwing for diverging implicit expansionHubert Plociniczak2013-04-261-4/+1
|/ | | | | | | | | | | | | | | Since we don't throw exceptions for normal errors it was a bit odd that we don't do that for DivergingImplicit. As SI-7291 shows, the logic behind catching/throwing exception was broken for divergence. Instead of patching it, I rewrote the mechanism so that we now another SearchFailure type related to diverging expansion, similar to ambiguous implicit scenario. The logic to prevent diverging expansion from stopping the search had to be slightly adapted but works as usual. The upside is that we don't have to catch diverging implicit for example in the presentation compiler which was again showing that something was utterly broken with the exception approach.
* Eliminate a pile of -Xlint warnings.Paul Phillips2013-04-233-6/+2
| | | | | | Some unused private code, unused imports, and points where an extra pair of parentheses is necessary for scalac to have confidence in our intentions.
* Merge pull request #2327 from paulp/pr/2315-rebasedPaul Phillips2013-04-024-6/+6
|\ | | | | SI-7261 Implicit conversion of BooleanSetting to Boolean and BooleanFlag
| * SI-7261 Implicit conversion of BooleanSetting to Boolean and BooleanFlagSom Snytt2013-03-274-6/+6
| | | | | | | | | | | | | | This commit shortens expressions of the form `if (settings.debug.value)` to `if (settings.debug)` for various settings. Rarely, the setting is supplied as a method argument. The conversion is not employed in simple definitions where the Boolean type would have to be specified.
* | Merge pull request #2316 from vigdorchik/interactive_test_frameworkPaul Phillips2013-03-292-12/+2
|\ \ | |/ |/| Improve testing interactive experience.
| * Improve testing interactive experience.Eugene Vigdorchik2013-03-262-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the exceptions that happen in the test are swallowed, as the JVM is forced to exit before printing the stack trace. Also assert message doesn't contain information about the problem. The call to "sys.exit" masks bugs in the testing framework, that has to be addressed more elaborately, so here we remove it. Also add the message parameter to assert to make it more informative. After removing "sys.exit" call, doc test starts failing. I suspect there might be a problem when expanding doc variables, but this should be addressed separately.
* | Overhauled local/getter/setter name logic.Paul Phillips2013-03-251-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | Sifted through extraneous methods trying to find consistency, consolidating and deprecating as I went. The original motivation for all this was the restoration of LOCAL_SUFFIX to originalName, because: It looks like in an attempt to make originalName print consistently with decodedName, I went a little too far and stripped invisible trailing spaces from originalName. This meant outer fields would have an originalName of '$outer' instead of '$outer ', which in turn could have caused them to be mis-recognized as outer accessors, because the logic of outerSource hinges upon "originalName == nme.OUTER". I don't know if this affected anything - I noticed it by inspection, improbably enough. Deprecated originalName - original, compared to what? - in favor of unexpandedName, which has a more obvious complement. Introduced string_== for the many spots where people have given up and are comparing string representations of names. A light dusting of types is still better than nothing. Editoral note: LOCAL_SUFFIX is the worst. Significant trailing whitespace! It's a time bomb.
* Merge pull request #2239 from paulp/pr/warningsAdriaan Moors2013-03-211-1/+1
|\ | | | | Warnings removal and other cleanup.
| * Eliminate a bunch of -Xlint warnings.Paul Phillips2013-03-121-1/+1
| | | | | | | | | | | | Mostly unused private code, unused imports, and points where an extra pair of parentheses is necessary for scalac to have confidence in our intentions.
* | Update sbt.latest.version to sbt's latest version.Paul Phillips2013-03-131-2/+3
|/ | | | And tweak deprecated stub so it compiles with 0.12.2.
* Eliminated all forInteractive/forScaladoc uses.Paul Phillips2013-03-092-5/+20
| | | | | | | | This is the commit which brings it all together. The booleans forInteractive and forScaladoc are now deprecated and are not inspected for any purpose. All behavioral changes formerly accomplished via tests of those flags are embodied in the globals built specifically for those tasks.
* Moved interactive code into src/interactive.Paul Phillips2013-03-092-3/+116
| | | | | As with scaladoc, pushes presentation compiler specific code into its separate source area.
* Moved interactive sources into separate directory.Paul Phillips2013-03-0924-0/+3456
As with the preceding commit, this has build-internal effects only.