summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Create possibility to skip flat classpath cachingmpociecha2014-12-053-5/+14
| | | | | | There's added -YdisableFlatCpCaching option to ScalaSettings which allows user to disable caching of flat representation of classpath elements.
* Integrate flat classpath with the compilermpociecha2014-12-0517-68/+440
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit integrates with the compiler the whole flat classpath representation build next to the recursive one as an alternative. From now flat classpath really works and can be turned on. There's added flag -YclasspathImpl with two options: recursive (the default one) and flat. It was needed to make the dynamic dispatch to the particular classpath representation according to the chosen type of a classpath representation. There's added PathResolverFactory which is used instead of a concrete implementation of a path resolver. It turned out that only a small subset of path resolvers methods is used outside this class in Scala sources. Therefore, PathResolverFactory returns an instance of a base interface PathResolverResult providing only these used methods. PathResolverFactory in combination with matches in some other places ensures that in all places using classpath we create/get the proper representation. Also the classPath method in Global is modified to use the dynamic dispatch. This is very important change as a return type changed to the base ClassFileLookup providing subset of old ClassPath public methods. It can be problematic if someone was using in his project the explicit ClassPath type or public methods which are not provided via ClassFileLookup. I tested flat classpath with sbt and Scala IDE and there were no problems. Also was looking at sources of some other projects like e.g. Scala plugin for IntelliJ and there shouldn't be problems, I think, but it would be better to check these changes using the community build. Scalap's Main.scala is changed to be able to use both implementations and also to use flags related to the classpath implementation. The classpath invalidation is modified to work properly with the old (recursive) classpath representation after changes made in a Global. In the case of the attempt to use the invalidation for the flat cp it just throws exception with a message that the flat one currently doesn't support the invalidation. And also that's why the partest's test for the invalidation has been changed to use (always) the old implementation. There's added an adequate comment with TODO to this file. There's added partest test generating various dependencies (directories, zips and jars with sources and class files) and testing whether the compilation and further running an application works correctly, when there are these various types of entries specified as -classpath and -sourcepath. It should be a good approximation of real use cases.
* Refactor scalap's mainmpociecha2014-12-012-87/+89
| | | | | | | | | | | | | The structure of scalap's Main has been refactored. EmptyClasspath is deleted. It looks that it was unused since this commit: https://github.com/scala/scala/commit/e594fe58ef8116a4bd2560ad0a856ad58ae9db33 Also classpath logging is changed and now uses asClassPathString method. It was needed to modify one test because of that but it won't depend on a particular representation. There aren't changes in the way scalap works.
* Create dedicated path resolver for the flat classpath representationmpociecha2014-11-302-11/+195
| | | | | | | | | | | | | | | | | | | | | This commit adds dedicated FlatClassPathResolver loading classpath entries as FlatClassPath. Most of the common logic from PathResolver for the old classpath has been moved to the base, separate class which isn't dependent on a particular classpath representation. Thanks to that it was possible to reuse it when creating an adequate path resolver for the flat classpath representation. This change doesn't modify the way the compiler works. It also doesn't change nothing from the perspective of someone who already uses PathResolver in some project or even extends it - at least as long as he/she doesn't need to use flat classpath. There are also added JUnit tests inter alia comparing entries created using the old and the new classpath representations (whether the flat one created using the new path resolver returns the same entries as the recursive one).
* Create base classpath factory and an implementation for the flat cpmpociecha2014-11-304-26/+103
| | | | | | | | | | | | The part of the functionality of a ClassPathContext has been moved to the base trait ClassPathFactory so it can be reused by the newly created FlatClassPathFactory. This new implementation works in similar manner as the ClassPathContext with this difference that it just creates instances of flat classpath. This change doesn't modify the behaviour of the compiler as the interface and the way ClassPathContext works didn't change. Moreover FlatClassPathFactory is currently unused.
* Add flat classpath implementation using ManifestResourcesmpociecha2014-11-301-4/+97
| | | | | | | | | | | | | | | | | | | | | | | | | There's added the flat classpath type using ManifestResources, closely related to the support for JSR-223 (Scripting for the Java Platform). It uses classes listed in the manifest file placed in the JAR. It's related to jar files so it's created using ZipAndJarFlatClassPathFactory and is cached. In general currently it's not possible to use it in Scala out of the box (without using additional tools such as jarlister) as this support is postponed. The old classpath has been properly prepared in the PR created by @rjolly https://github.com/scala/scala/pull/2238 so the new one also got this feature. ManifestResources is a ZipArchive without a real underlying file placed on a disk and in addition implementing some methods declared in AbstractFile as unsupported operations. Therefore the implementation has to use the iterator. I wanted to have the similar behaviour as in the case of directories and zip/jar files - be able to get a directory entry for a package without iterating all entries. This is achieved by iterating all entries only once and caching packages. This flat classpath type was the last needed one.
* Add flat classpath implementation for zip and jar filesmpociecha2014-11-305-6/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds an implementation of flat classpath which can handle both jar and vanilla zip files. In fact there are two versions - for a class- and a sourcepath. Both extend ZipArchiveFileLookup which provides common logic. They use FileZipArchive. @gkossakowski made a comparison of different ways of handling zips and jars (e.g. using javac's ZipFileIndex). He stated that general efficiency of FileZipArchive, taking into account various parameters, is the best. FileZipArchive is slightly changed. From now it allows to find the entry for directory in all directory entries without iterating all entries regardless of a type. Thanks to that we can simply find a directory for a package - like in the case of DirectoryFileLookup. There's also added possibility to cache classpath representation of classpath elements from jar and zip files across compiler instances. The cache is just a map AbstractFile -> FlatClassPath. It should reduce the number of created classpath and file instances e.g. in the case of many ScalaPresentationCompilers in Scala IDE. To prevent the possibility to avoid a cache, caches are created as a part of factories responsible for the creation of these types of the flat classpath.
* Add flat classpath implementation for directoriesmpociecha2014-11-304-1/+189
| | | | | | | | | | | There's added the flat classpath implementation for directories using java.util.File directly. Since we work with a real directory - not the AbstractFile - we don't need to iterate all entries of a file to get inner entries of some package. We can just find an adequate directory for a package. There are added implementations for a class- and a sourcepath. Both extend DirectoryFileLookup which provides common logic.
* Add the flat classpath type aggregating flat classpath instancesmpociecha2014-11-303-0/+339
| | | | | | | | | | | | | | | | | | | | | | | There's added AggregateFlatClassPath - an equivalent of MergedClassPath from the old implementation. It is supposed to group classpath instances handling different files being directories, zips or jars. Unlike in the case of the old (recursive) implementation, there won't be a deep, nested hierarchy of classpath instances - just one root (aggregate) and a flat structure of its children. AggregateFlatClassPath ensures the distinction of classpath entries and merges corresponding entries for class and source files into one entry. This is required as SymbolLoaders class makes use of this kind of ClassRepresentation. There are also added unit tests which check whether AggregateFlatClassPath obtains correct entries from classpath instances specified in a constructor and whether it preserves the ordering in the case of repeated entries. There's added a test type of flat classpath using VirtualFiles so it's easy to check the real behaviour.
* Define interface for flat classpath and add package loader using itmpociecha2014-11-303-0/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces the base trait for flat classpath - an alternative classpath representation. In accordance with the idea and the experimental implementation of @gkossakowski, this representation will try to make the best use of the specificity of a given file type instead of using AbstractFile everywhere. It's possible as .NET backend is no longer supported and we can focus on Java-specific types of files. FlatClassPath extends ClassFileLookup which provides the common interface used also by existing ClassPath. The new implementation is called flat because it's possible to query the whole classpath using just single instance. In the case of the old (recursive) representation there's the structure of nested classpath objects, where each such an object can return only entries from one level of hierarchy but it returns also another classpath objects for nested levels included in it. That's why there's added dedicated PackageLoaderUsingFlatClassPath in SymbolLoaders - approaches are different so also the way of loading packages has to be different. The new package loader is currently unused. There's added also PackageNameUtils which will provide common methods used by classpath implementations for various file types.
* Use new asClassPathString method and create FileUtils for classpathmpociecha2014-11-306-42/+88
| | | | | | | | | | | | | | The method asClasspathString is now deprecated. Moreover it's moved to ClassFileLookup in the case someone was using it in some project (an alternative classpath also will support it - just in the case). All its usages existing in Scala sources are changed to asClassPathString method. The only difference is the name. Some operations on files or their names are moved from ClassPath to the newly created FileUtils dedicated to classpath. It will be possible to reuse them when implementing an alternative classpath representation. Moreover such allocation-free extension methods like the one added in this commit will improve the readability.
* Abstract over ClassPath and ClassRepmpociecha2014-11-288-32/+83
| | | | | | | | | | | | | | | | | | | | | | This commit is intended to create the possibility to plug in into the compiler an alternative classpath representation which would be possibly more efficient, use less memory etc. Such an implementation - at least at the beginning - should exist next to the currently existing one and be possible to turn on using a flag. Several places in the compiler have a direct dependency on the classpath implementation. Examples include backend's icode generator and reader, SymbolLoaders, ClassfileParser. After closer inspection, one realizes that all those places depend only on a very small subset of classpath logic: they need to lookup classes from classpath. Hence there's introduced ClassFileLookup trait that encapsulates that functionality. The ClassPath extends that trait and an alternative one also must do it. There's also added ClassRepresentation - the base trait for ClassRep (the inner class of ClassPath). Thanks to that the compiler uses a type which is not directly related to the particular classpath representation as it was doing until now.
* Merge pull request #4149 from Ichoran/issue/8754Grzegorz Kossakowski2014-11-283-17/+26
|\ | | | | SI-8754 linear seqs aren't
| * SI-8754 linear seqs aren'tRex Kerr2014-11-263-17/+26
| | | | | | | | LinearSeqLike still isn't exactly linear (LinearSeqOptimized is), but at least the docs now give reasonably correct information about what is actually going on.
* | Merge pull request #4112 from retronym/ticket/8502Grzegorz Kossakowski2014-11-286-13/+74
|\ \ | | | | | | SI-8502 Improve resiliance to absent packages
| * | SI-8502 Improve resiliance to absent packagesJason Zaugg2014-11-286-13/+74
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When unpickling a class, we create stub symbols for references to classes absent from the current classpath. If these references only appear in method signatures that aren't called, we can proceed with compilation. This is in line with javac. We're getting better at this, but there are still some gaps. This bug is about the behaviour when a package is completely missing, rather than just a single class within that package. To make this work we have to add two special cases to the unpickler: - When unpickling a `ThisType`, convert a `StubTermSymbol` into a `StubTypeSymbol`. We hit this when unpickling `ThisType(missingPackage)`. - When unpickling a reference to `<owner>.name` where `<owner>` is a stub symbol, don't call info on that owner, but rather allow the enclosing code in `readSymbol` fall through to create a stub for the member. The test case was distilled from an a problem that a Spray user encountered when Akka was missing from the classpath. Two existing test cases have progressed, and the checkfiles are accordingly updated.
* | Merge pull request #4170 from retronym/ticket/disable-8946Jason Zaugg2014-11-281-0/+0
|\ \ | | | | | | SI-8946 Disable flaky test for reflection memory leak
| * | SI-8946 Disable flaky test for reflection memory leakJason Zaugg2014-11-281-0/+0
|/ / | | | | | | | | | | It passed in PR validation but failed in a later run. There are some clever ideas bouncing around to make it stable, but in the meantime I'll shunt it into disabled.
* | Merge pull request #3934 from teemulehtinen/fsc-port-argGrzegorz Kossakowski2014-11-265-27/+54
|\ \ | | | | | | FSC server port selected by argument
| * | Add option -port to fscTeemu Lehtinen2014-10-135-27/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Option "port" limits compile server lookup and start to given port. Normally fsc will start a compile server in a random port if no server is yet running. This can be problematic with firewalls and/or remote compile servers. Option "port" should not be confused with option "server" which looks for a compile server in given host and port and fails if such server is not found. Automatic tests for command line user interface do not exist at all. Thus, adding a test for one new option would require designing a whole new testing method.
* | | Merge pull request #4130 from mpociecha/let-specify-build-repos-homeGrzegorz Kossakowski2014-11-262-2/+5
|\ \ \ | | | | | | | | Let users specify a different location for build repos than user home
| * | | Let users specify a different location for build repos than user homempociecha2014-11-122-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is helpful e.g. when setting up CI for Scala and it's important which directories are used by a build. By default it uses .m2, .pax and .sbt/cache from user home (in general $HOME). Sometimes it's not possible to use this location and also changing a value of $HOME is not an option. The required location should be specified both for ant's build.xml and used scripts. In the first case specifying -Duser.home is all, what we need. But we can't just set _JAVA_OPTIONS as then partest tests fail due to the unexpected output (an additional 'Picked up java options (...)' messages). We can set ANT_OPTS instead of this. The only problem was that OSGi JUnit tests (only they) were using $HOME anyway. I forced them to use -Duser.home by propagating this option in build.xml. binary-repo-lib.sh is changed to use a special env variable or $HOME, when this variable is not set. Then we can do: export SCALA_BUILD_REPOS_HOME=<some_dir> export ANT_OPTS="$ANT_OPTS -Duser.home=$SCALA_BUILD_REPOS_HOME" ant dist and it will create all directories .m2, .pax and .sbt/cache in a specified $SCALA_BUILD_REPOS_HOME directory. Note: maven's settings.xml should be located in this used $SCALA_BUILD_REPOS_HOME/.m2 and point to the repository like <some_dir>/.m2/repository
* | | | Merge pull request #4148 from SpinGo/issue/SI-8946Jason Zaugg2014-11-263-2/+40
|\ \ \ \ | | | | | | | | | | SI-8946: Fixes memory leak when using reflection
| * | | | Fixes memory leak when using reflectionTim Harper2014-11-223-2/+40
| | |_|/ | |/| | | | | | | | | | | | | | | | | | References to Threads would be retained long after their termination if reflection is used in them. This led to a steady, long memory leak in applications using reflection in thread pools.
* | | | Merge pull request #4151 from som-snytt/issue/5205Adriaan Moors2014-11-241-3/+1
|\ \ \ \ | |/ / / |/| | | SI-5205 Finish applying octal deletion
| * | | SI-5205 Finish applying octal deletionSom Snytt2014-11-231-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | The original PR was partially applied to markdown. https://github.com/scala/scala-dist/pull/103
* | | | Merge pull request #4084 from vigdorchik/usecase_sigsGrzegorz Kossakowski2014-11-2117-12/+33
|\ \ \ \ | | | | | | | | | | Correct collections variable definitions to avoid many scaladoc warnings.
| * | | | Correct collections variable definitions to avoid many scaladoc warnings.Eugene Vigdorchik2014-11-0617-12/+33
| | | | |
* | | | | Merge pull request #4121 from retronym/ticket/5938Grzegorz Kossakowski2014-11-211-0/+35
|\ \ \ \ \ | | | | | | | | | | | | SI-5938 Test for a FSC bug with mixin, duplicate static forwarders
| * | | | | SI-5938 Test for a FSC bug with mixin, duplicate static forwardersJason Zaugg2014-11-091-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under resident compilation, we were getting multiple copies of static forwarders created for mixed in methods. It seems like the bug was fixed as a by-product of #4040. This commit adds a test to show this. I've confirmed that the test fails appropriately with 2.11.4. For future reference, before I figured out how to write the test for this one (test/resident doesn't seem to let you run the code after compiling it), I was using bash to test as follows: (export V=2.11.x; (scalac-hash $V sandbox/t5938_1.scala; (for i in 1 2; do echo sandbox/t5938.scala; done; printf '\n') | scalac-hash $V -Xresident); stty echo; scala-hash $V X ; echo ':javap -public X' | scala-hash $V);
* | | | | | Merge pull request #4099 from retronym/ticket/7596Grzegorz Kossakowski2014-11-217-1/+66
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7596 Curtail overloaded symbols during unpickling
| * | | | | | SI-7596 Curtail overloaded symbols during unpicklingJason Zaugg2014-11-067-1/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In code like: object O { val x = A; def x(a: Any) = ... } object P extends O.x.A The unpickler was using an overloaded symbol for `x` in the parent type of `P`. This led to compilation failures under separate compilation. The code that leads to this is in `Unpicklers`: def fromName(name: Name) = name.toTermName match { case nme.ROOT => loadingMirror.RootClass case nme.ROOTPKG => loadingMirror.RootPackage case _ => adjust(owner.info.decl(name)) } This commit filters the overloaded symbol based its stability unpickling a singleton type. That seemed a slightly safer place than in `fromName`.
* | | | | | | Merge pull request #4138 from stevegury/patch-1Grzegorz Kossakowski2014-11-211-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix one typo in the scaladoc of Inliners
| * | | | | | | Fix one typo in the scaladoc of InlinersSteve Gury2014-11-201-1/+1
| | |_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | The Scaladoc of `Inliners` contained one tiny typo for the word "accessibility". This PR only fixes this typo.
* | | | | | | Merge pull request #4115 from retronym/ticket/8597Grzegorz Kossakowski2014-11-219-6/+137
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | SI-8597 Improved pattern unchecked warnings
| * | | | | | SI-8597 Expand documentation of CheckabilityCheckerJason Zaugg2014-11-181-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Cherry picking some of the previous commit message.
| * | | | | | SI-8597 Improved pattern unchecked warningsJason Zaugg2014-11-099-5/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The spec says that `case _: List[Int]` should be always issue an unchecked warning: > Types which are not of one of the forms described above are > also accepted as type patterns. However, such type patterns > will be translated to their erasure (§3.7). The Scala compiler > will issue an “unchecked” warning for these patterns to flag > the possible loss of type-safety. But the implementation goes a little further to omit warnings based on the static type of the scrutinee. As a trivial example: def foo(s: Seq[Int]) = s match { case _: List[Int] => } need not issue this warning. These discriminating unchecked warnings are domain of `CheckabilityChecker`. Let's deconstruct the reported bug: def nowarn[T] = (null: Any) match { case _: Some[T] => } We used to determine that if the first case matched, the scrutinee type would be `Some[Any]` (`Some` is covariant). If this statically matches `Some[T]` in a pattern context, we don't need to issue an unchecked warning. But, our blanket use of `existentialAbstraction` in `matchesPattern` loosened the pattern type to `Some[Any]`, and the scrutinee type was deemed compatible. I've added a new method, `scrutConformsToPatternType` which replaces pattern type variables by wildcards, but leaves other abstract types intact in the pattern type. We have to use this inside `CheckabilityChecker` only. If we were to make `matchesPattern` stricter in the same way, tests like `pos/t2486.scala` would fail. I have introduced a new symbol test to (try to) identify pattern type variables introduced by `typedBind`. Its not pretty, and it might be cleaner to reserve a new flag for these. I've also included a test variation exercising with nested matches. The pattern type of the inner case can't, syntactically, refer to the pattern type variable of the enclosing case. If it could, we would have to be more selective in our wildcarding in `ptMatchesPatternType` by restricting ourselves to type variables associated with the closest enclosing `CaseDef`. As some further validation of the correctness of this patch, four stray warnings have been teased out of neg/unchecked-abstract.scala I also had to changes `typeArgsInTopLevelType` to extract the type arguments of `Array[T]` if `T` is an abstract type. This avoids the "Checkability checker says 'Uncheckable', but uncheckable type cannot be found" warning and consequent overly lenient analysis. Without this change, the warning was suppressed for: def warnArray[T] = (null: Any) match { case _: Array[T] => }
* | | | | | | Merge pull request #4123 from retronym/ticket/8253Jason Zaugg2014-11-204-1/+58
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-8253 Fix incorrect parsing of <elem xmlns={f("a")}/>
| * | | | | | | SI-8253 Fix incorrect parsing of <elem xmlns={f("a")}/>Jason Zaugg2014-11-104-1/+58
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The spliced application was placed in the `attrMap` in `SymbolicXMLBuilder` and later incorrectly matched by a pattern intended only to match: xml.Text(s) That attribute value is generated by parsing: <elem xmlns='a'/> So the net effect was that the two fragments of XML were identical! This commit sharpens up the match to really look for a syntactic `_root_.scala.xml.Text("...")`. The test just prints the parse trees of a variety of cases, as we we should not test the modularized XML library in scala/scala.
* | | | | | | Merge pull request #4132 from phaller/ticket/7444Jason Zaugg2014-11-191-8/+10
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-7444 docs: null Executor allowed in ExecutionContext factories
| * | | | | | | SI-7444 docs: null Executor allowed in ExecutionContext factoriesPhilipp Haller2014-11-141-8/+10
| | |_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Update the ScalaDoc for the factory methods for `ExecutionContext` which allow a `null` `Executor`/`ExecutorService`.
* | | | | | | Merge pull request #4118 from retronym/ticket/5639Jason Zaugg2014-11-1913-15/+185
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-5639 Fix spurious discarding of implicit import
| * | | | | | | SI-5639 Predicate bug fix on -Xsource:2.12Jason Zaugg2014-11-185-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To be conservative, I've predicated this fix in `-Xsource:2.12`. This is done in separate commit to show that the previous fix passes the test suite, rather than just tests with `-Xsource:2.12`.
| * | | | | | | SI-5639 Fix spurious discarding of implicit importJason Zaugg2014-11-099-15/+152
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Scala fa0cdc7b (just before 2.9.0), a regression in implicit search, SI-2866, was discovered by Lift and fixed. The nature of the regression was that an in-scope, non-implicit symbol failed to shadow an eponymous implicit import. The fix for this introduced `isQualifyingImplicit` which discards in-scope implicits when the current `Context`'s scope contains a name-clashing entry. Incidentally, this proved to be a shallow solution, and we later improved shadowing detection in SI-4270 / 9129cfe9. That picked up cases where a locally defined symbol in an intervening scope shadowed an implicit. This commit includes the test case from the comments of SI-2866. Part of it is tested as a neg test (to test reporting of ambiguities), and the rest is tested in a run test (to test which implicits are picked.) However, in the test case of SI-5639, we see that the scope lookup performend by `isQualifyingImplicit` is fooled by a "ghost" module symbol. The apparition I'm referring to is entered when `initializeFromClassPath` / `enterClassAndModule` encounters a class file named 'Baz.class', and speculatively enters _both_ a class and module symbol. AFAIK, this is done to defer parsing the class file to determine what inside. If it happens to be a Java compiled class, the module symbol is needed to house the static members. This commit adds a condition that `Symbol#exists` which shines a torch (forces the info) in the direction of the ghost module symbol. In our test, this causes it to vanish, as we only need a class symbol for the Scala defined `class Baz`. The existing `pos` test for this actually did not exercise the bug, separate compilation is required. It was originally checked in to `pending` with this error, and then later moved to `pos` when someone noticed it was not failing.
* | | | | | | Merge pull request #4051 from heathermiller/repl-cp-fix2Jason Zaugg2014-11-188-18/+354
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-6502 Reenables loading jars into the running REPL (regression in 2.10)
| * | | | | | | SI-6502 Refactorings suggested by reviewHeather Miller2014-11-103-33/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Moves mergeUrlsIntoClassPath from Global into ClassPath - Revises and documents AbstractFile.getURL
| * | | | | | | SI-6502 Moving methods concerned with the state of Global from IMain to GlobalHeather Miller2014-11-052-33/+36
| | | | | | | |
| * | | | | | | Addresses review commentsHeather Miller2014-11-052-28/+9
| | | | | | | |
| * | | | | | | Adds tests that programatically generate jarsHeather Miller2014-11-052-0/+109
| | | | | | | |
| * | | | | | | SI-6502 Addresses comments by @som-snyttHeather Miller2014-11-051-9/+3
| | | | | | | |