aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Make colltest6 self-containedMartin Odersky2016-07-272-1/+2
| | | | Following the other colltests, put each in a separate package.
* Simplify lexicallyEnclosingClassMartin Odersky2016-07-271-12/+3
|
* Quick-fix eclosingMethod attribute generation for t3048.scalaDmitry Petrashko2016-07-272-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a funny interaction between: elim-by-name(and erasure specifically); lift-static; supercalls. object E extends F2(new B {}) Here we have an anonymous class new B {} that looks like it is created by erasure. For some reason this class forgets the link to original anonymous class: SymDenot(E$annon1).initial.phase == erasure. I guess this is a bug. Additionally, the owner of E$annon1 is an anonymous method inside E, that is inSuperCall and thus we have an anonymous nested class that has enclosingClass be package. This class looks like a top-level anonymous class breaking a lot of assumptions in shared backend and taking multiple branches in unexpected ways. I'm not sure that this is a proper fix. I assume there's a bigger bug around, but I don't quite understand it right now and I need to work on other stuff. Making a quick fix to unblock @odersky.
* Move test from pos to runMartin Odersky2016-07-271-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test generated code before but fails with verify error at runtime. Here's the message: Exception in thread "main" java.lang.VerifyError: Bad type on operand stack Exception Details: Location: D$.<init>()V @2: invokedynamic Reason: Type uninitializedThis (current frame, stack[1]) is not assignable to 'D$' Current Frame: bci: @2 flags: { flagThisUninit } locals: { uninitializedThis } stack: { uninitializedThis, uninitializedThis } Bytecode: 0x0000000: 2a2a ba00 1f00 00b7 0022 2ab3 0024 b1 at Test$.main(t3048.scala:13) at Test.main(t3048.scala) With the fix in last commit, test causes backend to crash with java.lang.AssertionError: assertion failed: val <none> at scala.Predef$.assert(Predef.scala:165) at scala.tools.nsc.backend.jvm.BCodeHelpers$BCInnerClassGen$class.assertClassNotArray(BCodeHelpers.scala:214) at scala.tools.nsc.backend.jvm.BCodeHelpers$BCInnerClassGen$class.assertClassNotArrayNotPrimitive(BCodeHelpers.scala:219) at scala.tools.nsc.backend.jvm.BCodeHelpers$BCInnerClassGen$class.getClassBTypeAndRegisterInnerClass(BCodeHelpers.scala:238) at scala.tools.nsc.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.getClassBTypeAndRegisterInnerClass(BCodeSkelBuilder.scala:51) at scala.tools.nsc.backend.jvm.BCodeHelpers$BCInnerClassGen$class.internalName(BCodeHelpers.scala:210)
* Fix problem related to cbn parameters in supercallsMartin Odersky2016-07-274-18/+21
| | | | | | | | | | | The closures generated by elimByName did not get the InSuperCall flag set. This caused problems in lambda lift which led to a verify error for the new version CollectionStrawMan6. That version replaces explicit function parameters in class LazyList by by-name parameters. Also: Clarify logic for liftLocals in LambdaLift (liftLocals caused the immediate problem but was in the end not to blame).
* Rename fromLikeIterable -> fromIterableWithSameElemTypeMartin Odersky2016-07-273-35/+35
| | | | Makes it clearer what it is. Also, fixed check file.
* Fix substDealiasMartin Odersky2016-07-272-7/+17
| | | | | | substDealias did not follow aliases when the prefix of a typeref changed under substitution. This was exhibited by a bug in extensionMethods which was first discovered in CollectionStrawMan6 and was minimized in extmethods.
* Improve dropMartin Odersky2016-07-272-21/+7
| | | | | By making LinearSeq an IterableLike, we can use tail-recursion on drop.
* Further extension with LazyListMartin Odersky2016-07-264-209/+1081
| | | | | Demonstrates how to integrate lazy non-view collections in the framework.
* Add arrays to collection strawmanMartin Odersky2016-07-254-0/+1496
| | | | | This PR investigates what it takes to extend CollectionStrawMan5 to arrays.
* Merge pull request #1413 from dotty-staging/fix-#1385odersky2016-07-254-2/+57
|\ | | | | Fix #1385: Temporarily lift 22 limit for functions
| * Adress reviewers commentsMartin Odersky2016-07-252-2/+2
| |
| * Fix #1385: Temporarily lift 22 limit for functionsMartin Odersky2016-07-254-2/+57
|/
* Merge pull request #1407 from dotty-staging/fix-#1401liu fengyun2016-07-228-15/+71
|\ | | | | Fix #1401: Make sure all references are forwarded
| * Resume suspensions also when reading from classfilesMartin Odersky2016-07-224-10/+17
| | | | | | | | | | Make treatment in Scala2Unpickler and Namer the same and factor out common functionality.
| * Fix #1401: Make sure all refs are forwardedMartin Odersky2016-07-216-10/+59
| | | | | | | | | | | | | | | | | | | | | | | | Faced with recursive dependencies through self types, we might have to apply `normalizeToClassRefs` to a class P with a parent that is not yet initialized (witnessed by P's parents being Nil). In that case we should still execute forwardRefs on P, but we have to wait in a suspension until P is initialized. This avoids the problem raised in #1401. I am still not quite sure why forwardRefs is needed, but it seems that asSeenFrom alone is not enough to track the dependencies in this case.
| * Tweaks to printingMartin Odersky2016-07-212-2/+2
|/ | | | | - increase page width - print scopes more legibly under -verbose
* Merge pull request #1395 from dotty-staging/fix-#1378odersky2016-07-218-13/+45
|\ | | | | Fix #1378: Propagate more knowledge of result type into applications
| * Disable stdlib testMartin Odersky2016-07-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Interestingly, adding mutable.BufferLike to the whitelist succeeds under junit but fails under partest. Unfortunately I can't see any output in the log indicating what went wrong. I only see this: !! 306 - pos/compileStdLib [compilation failed] # Failed test paths (this command will update checkfiles) test/partest --update-check \ /Users/odersky/workspace/dotty/tests/partest-generated/pos/compileStdLib
| * Add test to whitelistMartin Odersky2016-07-171-0/+1
| | | | | | | | This should have been done in a PR that was merged before.
| * Adress reviewers commentsMartin Odersky2016-07-173-8/+10
| |
| * Proparage function result constrains when inferring parameter typesMartin Odersky2016-07-165-2/+33
| | | | | | | | | | | | | | | | If an application has functions with implicit parameter types we need to be more aggressive about propagating knowledge of the expected result type into the constraint. Fixes #1378.
| * Add recursive calls to classBoundMartin Odersky2016-07-161-2/+2
| | | | | | | | As observed by @smarter, makes sense to do this.
| * Fix error printing in compiler testMartin Odersky2016-07-161-9/+7
| | | | | | | | Error messages were suppressed so far, now get printed.
* | Merge pull request #1406 from dotty-staging/fix-output-diffodersky2016-07-212-3/+6
|\ \ | | | | | | Make -Xprint-diff an opt-in option.
| * | Make -Xprint-diff an opt-in option.Nicolas Stucki2016-07-202-3/+6
|/ / | | | | | | | | | | * -Xprint:[...] alone prints the trees without diffs. * -Xprint-diff enables the diff on -Xprint. * -Xprint-diff-del enables the diff with deletes on -Xprint.
* | Merge pull request #1402 from dotty-staging/fix-wildcard-protosGuillaume Martres2016-07-193-4/+18
|\ \ | | | | | | Fix wildcard protos
| * | Add test caseMartin Odersky2016-07-191-0/+11
| | |
| * | Refine printing of tuple an function types with wildcardsMartin Odersky2016-07-191-3/+3
| | |
| * | Allow function prototypes to have wildcards.Martin Odersky2016-07-191-1/+4
| | |
* | | Merge pull request #1400 from dotty-staging/fix/hk-reduce-typerefsodersky2016-07-194-15/+31
|\ \ \ | |/ / |/| | HK reduction: Remove special-case for typerefs
| * | HK reduction: Remove special-case for typerefsGuillaume Martres2016-07-183-15/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The special case: case stripped: TypeRef => stripped.symbol.is(BaseTypeArg) is wrong because you might still want to reduce applications involving TypeRefs which are not base class parameters, like in: class Foo[A] type Alias[X] = Foo[X] val x: Alias[Int] = ??? `Alias` is a TypeRef so before this commit `Alias[Int]` was never reduced to `Foo[Int]`. It should have been: case stripped: TypeRef if stripped.symbol.is(BaseTypeArg) => true But even this is incorrect: it assumes that we can always safely reduce HK applications involving base class parameters, this is not the case when the parameter kind is different from the rhs kind as illustrated by `i1181c.scala`. We fix this by simply dropping the special case.
| * | Better test for #1181Guillaume Martres2016-07-181-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we implement partial higher-order unification (SI-2712 fix) i1181.scala will compile even if `Alias[Int]` gets dealiased to `(Int, Int)` because we can unify the latter with `M[_]` where `M = [X] -> (Int, X)`. The new test will only succeed if `Alias[Int, Int]` is not dealiased because we will never unify `Foo[Int]` with `M[_,_]`.
* | | Merge pull request #1393 from dotty-staging/fix-#1386odersky2016-07-182-6/+40
|\ \ \ | | | | | | | | Fix #1386: Reduce double def errors
| * | | Refactor code into nested methodMartin Odersky2016-07-151-5/+6
| | | | | | | | | | | | | | | | mergeDenot is already large as it is.
| * | | Refine disambiguation logic and add test case.Martin Odersky2016-07-152-3/+18
| | | |
| * | | Fix #1386: Reduce double def errorsMartin Odersky2016-07-151-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use additional disambiguation criteria before raising a double def error. See for context: #1240. Review by @darkdimius
* | | | Merge pull request #1399 from dotty-staging/fix-patmat-typingodersky2016-07-183-8/+37
|\ \ \ \ | | | | | | | | | | Fix typing of match expressions
| * | | | Fix test error annotationMartin Odersky2016-07-181-1/+1
| | | | |
| * | | | Add test caseMartin Odersky2016-07-182-1/+25
| | | | | | | | | | | | | | | | | | | | Also fix reviewers comments about `firstParent`
| * | | | Fix typing of match expressionsMartin Odersky2016-07-172-8/+13
| | |_|/ | |/| | | | | | | | | | | | | | Allow matches between unapply types and selector type where a possible overlap might exist.
* | | | Merge pull request #1389 from dotty-staging/fix-#1381odersky2016-07-187-76/+151
|\ \ \ \ | |_|_|/ |/| | | Changes to overloading
| * | | Make run tests for #1381.Nicolas Stucki2016-07-183-36/+66
| | | |
| * | | Add testsMartin Odersky2016-07-153-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | Adds the original test form #1381. t2660 looks similar. Also adds some unrelated tests I had in the queue that now compile.
| * | | Additions to testMartin Odersky2016-07-151-0/+9
| | | |
| * | | Changes to overloadingMartin Odersky2016-07-153-76/+73
| | | | | | | | | | | | | | | | | | | | | | | | Fix #1381: Overloading is now changed so that we first try without implicit searches. Only if that leaves no applicable alternatives we try again with implicit search turned on. This also fixes test case t2660, which got moved from neg to pos.
* | | | Merge pull request #1345 from dotty-staging/improve-XprintDmitry Petrashko2016-07-174-9/+105
|\ \ \ \ | |_|/ / |/| | | Improve Xprint
| * | | Fix #1312: Improve XprintNicolas Stucki2016-07-154-9/+105
| |/ / | | | | | | | | | | | | | | | | | | * Do not reprint a tree that has not changed. * Highlight changes with yellow and insertions in green. * -Xprint-diff-del: Inserts the deleted parts of the tree in red and the parts that where changed in magenta.
* | | Merge pull request #1377 from dotty-staging/#1365odersky2016-07-153-22/+80
|\ \ \ | | | | | | | | Fix 1365: Fix bindings in patterns
| * | | Drop superfluous codeMartin Odersky2016-07-151-5/+1
| | | | | | | | | | | | | | | | The dropped lines were both pure functions whose result is ignored.