aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1067 from dotty-staging/fix-1065odersky2016-02-081-2/+10
|\ | | | | Fix #1065 erasedLub for arrays of primitives.
| * Fix #1065 erasedLub for arrays of primitives.Dmitry Petrashko2016-02-081-2/+10
| | | | | | | | | | | | Unlike arrays of objects, that can be accessed as an array of a super type of this object, int[] cannot be accessed as an array of primitives.
* | Merge pull request #1063 from dotty-staging/fix-#803Dmitry Petrashko2016-02-081-3/+6
|\ \ | | | | | | Handle "missing args" case when expected type is a singleton type.
| * | Handle "missing args" case when expected type is a singleton type.Martin Odersky2016-02-051-3/+6
| | | | | | | | | | | | Fixes #803.
* | | Merge pull request #1057 from dotty-staging/fix/hide-stacktracesodersky2016-02-069-9/+11
|\ \ \ | | | | | | | | Hide stack traces behind -Ydebug
| * | | Do not use the plain printer with -YdebugGuillaume Martres2016-02-062-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Instead, a new setting called -Yplain-printer is used for this. After this commit, we can now run all tests with -Ydebug (this was not the case before because using the plain printer breaks -Ytest-pickler)
| * | | Do not store context creation trace with -YdebugGuillaume Martres2016-02-062-1/+2
| | | | | | | | | | | | | | | | | | | | This makes the compiler extremely slow. To store the trace, you now need to pass -Ytrace-context-creation
| * | | Do not use println when SingleDenotation#signature failsGuillaume Martres2016-02-051-1/+1
| | | |
| * | | Hide stack traces behind -YdebugGuillaume Martres2016-02-055-6/+6
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | They're not very useful for end users and some tests like tests/neg/selfreq.scala always print these exceptions which makes it harder to read the test logs, Also use Thread.dumpStack() instead of creating an Exception and calling printStackTrace() on it.
* | | Fix #1044: handle TypevarsMissContext mode in wildApproxGuillaume Martres2016-02-062-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `wildApprox` encounters a PolyParam it approximates it by its bounds in the current constraint set, but this is incorrect if `TypevarsMissContext` is set, we might get the bounds of another use of this `PolyType`. This is exactly what happened in i1044.scala where the implicit view `refArrayOps` needs to be used twice with two different type parameters. The fix is to approximate a PolyParam by its original bounds in its PolyType if `TypevarsMissContext` is set. This fix was inspired by the approach of #1054.
* | | Merge pull request #1060 from dotty-staging/throwMethodInitodersky2016-02-051-1/+1
|\ \ \ | | | | | | | | Force the initialization of throwMethod in Definitions
| * | | Force the initialization of throwMethod in DefinitionsVladimirNik2016-02-051-1/+1
| |/ /
* | | Surive non-existing sourceModule in Scala2 pickled info.Martin Odersky2016-02-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | It seems when unpickling nsc that some module classes come without a source module. Survive this situation rather than crashing. i859.scala is an example. i859 compiles with the patch, but causes a deep subtype when unpickling. Not sure whether scalac does the same.
* | | Handle subtyping of LazyVals that are in train of being evaluated.Martin Odersky2016-02-051-2/+5
| | | | | | | | | | | | | | | Instead of forcing again, and causing an assertion error, back out assuming that the result is false. Fixes first problem with #859.
* | | Make LazyRef#ref a def instead of a lazy valMartin Odersky2016-02-051-1/+2
|/ / | | | | | | | | It's slightly more efficient. There was no need to have a separate cache for the lazy val.
* | Use Context#setReporter where possibleGuillaume Martres2016-02-051-2/+1
| |
* | Context: set compilerCallback like other context variablesGuillaume Martres2016-02-042-16/+7
| | | | | | | | | | | | Previously, we could set compilerCallback on non-fresh contexts, but there is no reason that this should be allowed, and this is not done anymore in the code since the last commit.
* | Better compiler entry pointsGuillaume Martres2016-02-042-10/+49
| | | | | | | | | | | | | | | | | | - Document the entry points - It is now possible to set a custom reporter without using a custom context - Use `null` for optional arguments to make it easier to run the compiler using reflection or from Java. - DPDirectCompiler does not use a custom context anymore
* | Compiler: use the reporter passed from the DriverGuillaume Martres2016-02-042-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | With this commit and the previous one, partest should finally correctly log the output of the compiler and display it at the end of its execution if compilation failed. Also make sure the initial Reporter in a Context is _not_ a ThrowingReporter. Previously, the initial Reporter was always overriden in Compiler by rootReporter so it had no effect, but this is not the case anymore, and the negative junit tests fail with the ThrowingReporter since they throw an exception instead of exiting with a certain number of errors.
* | Driver: properly use root Context passed as argumentGuillaume Martres2016-02-041-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also CompilerTest no longer runs the compiler with the context DottyTest#ctx. Previously, we got away with this because Compiler#process ignored it and created a new Context, but this commit fixes this, and it is now very important that we use a different context for every test we compile. Since DottyTest#ctx was the only part of DottyTest we used, CompilerTest no longer extends DottyTest to make sure that we do not use it accidentally. If we want to use DottyTest as a base class for tests again, we will have to remove its implicit Context field first. Also do not try to initialize the definitions in the context used by partest, this is not necessary.
* | Reporter: make summary available without a ContextGuillaume Martres2016-02-041-5/+16
| |
* | ConsoleReporter: remove unused argument ctxGuillaume Martres2016-02-043-3/+3
|/
* Fix i939: Patmat shouldn't compare selectors to module TypeTrees.Dmitry Petrashko2016-01-241-1/+2
| | | | | | | | It would be great to augment Ycheck to ensure that some trees are not permitted, e.g. TypeTree cannot be a stat in a block or a receiver of a call. Currently this is `ensured` by backend by failing.
* Merge pull request #1039 from dotty-staging/fix-#998Guillaume Martres2016-01-231-3/+22
|\ | | | | Fix #998
| * Fix #998Martin Odersky2016-01-201-3/+22
| | | | | | | | Needed a fix in approximateUnion.
* | Merge pull request #1038 from dotty-staging/fix-#1037Guillaume Martres2016-01-234-8/+16
|\ \ | | | | | | Fix #1037
| * | Perform isCurrent at transform phaseMartin Odersky2016-01-191-3/+8
| | | | | | | | | | | | instead of the one after it. Fixes problem with t7475b.scala
| * | Small refactoringMartin Odersky2016-01-191-2/+5
| | |
| * | Don't force symbol denotation when taking fingerprint.Martin Odersky2016-01-192-2/+2
| | |
| * | Avoid repeated evaluations of parentIsYounger.Martin Odersky2016-01-191-1/+1
| |/
* / Fix #1036Martin Odersky2016-01-201-1/+6
|/ | | | Achieved by tweaking from where we get the parameter types of an eta-expansion.
* Check AppliedTypeTrees bounds inside AppliedTypeTreeGuillaume Martres2016-01-181-7/+10
|
* Avoid infinite subtyping checks when intersecting denotationsGuillaume Martres2016-01-182-12/+32
| | | | This allows us to run compileStdLib without deep subtypes again.
* Avoid caching the wrong bounds in TypeRefsMartin Odersky2016-01-181-1/+16
| | | | | Checking bounds everywhere revealed a problem in compileStdLib, which this commit fixes.
* Check bounds everywhereMartin Odersky2016-01-183-29/+35
| | | | | | | | Previously, bounds of a TypeDef tree were not checked. We now make sure bounds are checked everywhere in PostTyper. The previous partial check in Applications gets removed (it was not complete even for TypeApplications because sometimes bounds were not yet known when the test was performed.)
* Keep rhs of TypeDef in typed treeMartin Odersky2016-01-182-2/+10
| | | | | This is important for IDEs who want to see the full tree. The tree now gets replaced by a TypeTree in PostTyper.
* Fix caching bug: don't assume that tvars instantiation cannot be retractedGuillaume Martres2016-01-171-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When TypeVar#inst is empty but an instantiation exists in the typer state, we should set ephemeral to true, because this instantiation will be retracted if we throw away the current typer state. This makes hkrange.scala pass, it compiled before but the type parameter of `f` was inferred to be `Nothing` because of this bug, and this failed Ycheck. For anyone who wonders how caching bugs manifest themselves, here's what happened in details in hkrange.scala: 1. In an ExploreTyperState we set `CC` to be `IndexedSeq` in the constraint set 2. In that same typer state the TypeRef `CC[Int]` (it's a TypeRef because `CC` is a type lambda) gets the denotation `IndexedSeq[Int]`, which is correct, but the denotation is cached since `ephemeral` is false, which is wrong. 3. Later, we retract the ExplorerTyperState, so `CC` is uninstantiated again and unconstrained. 4. Then we do the subtyping check `CC[Int] <:< IndexedSeq[Int]`, because the denotation of `CC[Int]` was cached, this returns true, but `CC` stays unconstrained. 5. This means that when we instantiate `CC`, we get `Nothing` After this fix, the TypeRef denotation is no longer cached, so when we do `CC[Int] <:< IndexedSeq[Int]`, `CC` gets constrained as expected.
* Merge pull request #1021 from dotty-staging/fix/procedure-migrationodersky2016-01-171-1/+1
|\ | | | | Improve migration message for Scala 2 procedures
| * Improve migration message for Scala 2 proceduresGuillaume Martres2016-01-141-1/+1
| | | | | | | | | | | | It's not correct to just add `=` you also need to specify the return type to be `Unit` otherwise things may not work as expected, this is especially important for a `main` method.
* | Always eta-expand AppliedTypeTrees argumentsGuillaume Martres2016-01-161-1/+1
| | | | | | | | This makes compileIndexedSeq pass again.
* | Compute type params in namer without completing the whole infoMartin Odersky2016-01-164-15/+49
| | | | | | | | | | | | | | | | | | Type params should be computed before computing the whole info of a type. Without the patch we get a cyclic reference in the compileMixed test. Note that compileIndexedSeq does not pass with this commit (it passed before), this is fixed in the next commit.
* | Fix checkNonCyclic.Martin Odersky2016-01-161-6/+6
| | | | | | | | | | | | | | Need to also look info refined types. Need to handle case where we hit a NoCompleter again. Fixes #974 and makes MutableSortedSetFactory in stdlib compile.
* | Make skolems uncachedMartin Odersky2016-01-161-2/+2
|/ | | | | | There was no reason in the first case to cache them, as their equality is reference identity. Maybe this fixes the OOM errors we encounter.
* Partest dotty non-bootstrapped.Dmitry Petrashko2016-01-131-1/+1
| | | | | | Needs to go in before https://github.com/scala/scala-jenkins-infra/pull/152 is deployed
* Merge pull request #1004 from dotty-staging/linker/typesodersky2016-01-063-30/+38
|\ | | | | Subtle changes to TypeComarer needed for Linker.
| * Mark TermRefWithFixedSym as non-final.Dmitry Petrashko2016-01-041-2/+3
| |
| * Allow comparisons between TypeRefs and ThisTypes.Dmitry Petrashko2016-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Motivation comes from Linker: List$.canBuildFrom is implemented as ReusableCBF.asInstanceOf[GenericCanBuildFrom[A]] static type of field ReusableCBF here is TypeRef(TypeRef(List$), GenericCanBuildFrom[Nothing]) but the ident ReusableCBF gets type TypeRef(ThisType(List$), GenericCanBuildFrom[Nothing]) We already permit comparisons between static TermRefs and ThisTypes, this change additionally allows TypeRefs to static modules to become subtypes of ThisTypes of static modules.
| * Linker specific: add note to withSymAndName.Dmitry Petrashko2015-12-201-0/+4
| |
| * LinkerSpecific: make functionality of ResolveSuper accessible.Dmitry Petrashko2015-12-201-27/+30
| | | | | | | | | | Linker needs to resolve super calls before they are rewritten in the tree.
* | VCArrayPrototype: replace override "def clone" by "def clone()"Guillaume Martres2016-01-041-1/+1
| | | | | | | | | | | | This prevented Dotty from bootstrapping when the file arguments were given in a certain order because of #1017. Regardless of what we do regarding #1017, it makes sense to use "def clone()" here.