aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #509 from dotty-staging/add/expandSAMsDmitry Petrashko2015-05-042-0/+80
|\ | | | | Expand SAM closures to anonymous classes if needed
| * More conditions under which SAMs are converted to anonymous classesMartin Odersky2015-05-021-0/+12
| | | | | | | | | | | | | | Also included are - Closures implementing classes that inherit from a class other than Object - Closures that implement traits which run initialization code.
| * Make sure types of pattern bound variables are fully-defined.Martin Odersky2015-05-021-0/+5
| | | | | | | | | | | | | | | | | | Like all other variables, pattern-bound vars need a fully defined type. I was thinking originally that demanding a fully defined selector type is sufficient to ensure this, but that's not true: An outer pattern might call a polymorphic unapply and its type variables need not be fully instantiated. With the fix, the minimized test case from ExpandSAMs works.
| * New miniphase: ExpandSAMsMartin Odersky2015-05-021-0/+63
| | | | | | | | The phase replaces SAM closures with anonymous classes when necessary.
* | Merge pull request #529 from dotty-staging/fix/#503Dmitry Petrashko2015-05-042-0/+30
|\ \ | | | | | | Fix of #503
| * | New testsMartin Odersky2015-05-042-1/+22
| | | | | | | | | | | | | | | Added test for previous PR on super accessors. Updated test for #503 to check both inner classes and inner traits.
| * | Treat references to modules and lazy vals as outer referencesMartin Odersky2015-05-041-0/+9
| | | | | | | | | | | | Previously, we considered only methods. #503 shows that this is wrong.
* | | Fix compatibility of Java with value classesGuillaume Martres2015-05-043-0/+19
|/ / | | | | | | | | | | | | | | | | | | This avoids getting a runtime error when calling a Java-defined method whose signature contains value classes. It happened because we erased the value classes in this signature even though it comes from a classfile. Amusingly, this problem also exists in scalac: <https://issues.scala-lang.org/browse/SI-9298>
* | Merge pull request #517 from dotty-staging/add/expand-privatesodersky2015-05-041-0/+4
|\ \ | | | | | | Expand private members if necessary
| * | New miniphase: ExpandPrivateMartin Odersky2015-05-011-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A late miniphase which resets private flag of all members that are not accessed from within same class. Replaces logic in RefChecks. Doing this late has two advantages - we can use name expansion, because references are symbolic, so the names of symbols and references to them do not need to correspond anymore. - we can automatically correct for symbols moved in earlier phases (e.g. lifted out by LambdaLift).
* | | Merge pull request #526 from dotty-staging/fix/#522odersky2015-05-033-0/+25
|\ \ \ | | | | | | | | Fix #522.
| * | | Moved tests from pendingMartin Odersky2015-05-033-5/+20
| | | |
| * | | Fix #522.Martin Odersky2015-05-031-0/+10
| | | | | | | | | | | | | | | | | | | | We were missing a substitution in full parameterization. Embarraingly, this made even the example in the doc comment of `fullyParameterizedDef` fail.
* | | | Enable test strip-tvars-for-lubbasetypes.scalaGuillaume Martres2015-05-031-0/+25
|/ / / | | | | | | | | | | | | The test had to be slightly modified because of dotty's stricter checking of type bounds validity, see #525 where this was discussed.
* | / Fix #523: Instantiate lower bound when bounds checkingMartin Odersky2015-05-021-0/+8
| |/ |/| | | | | | | | | | | | | Lower bounds need to be instantiated just like upper bounds. F-bounded polymorphism (which only applies too upper bounds) is one reason for instantiating arguments, but parameters referring to other parameters is another one. An the latter applies to lower bounds as well.
* | Enable pending pos tests related to value classesGuillaume Martres2015-05-015-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | Each test needs to have its own package because pos_all will try to compile the whole valueclasses directory at once. The remaining tests with "extends AnyVal" in tests/pending/pos are related to separate compilation, except for: - t6482.scala and t7022.scala which were fixed by https://github.com/scala/scala/pull/1468 in scalac and seem to trigger a similar bug in FullParameterization - strip-tvars-for-lubbasetypes.scala which was fixed by https://github.com/scala/scala/pull/1758 in scalac
* | Enable untried pos tests related to value classesGuillaume Martres2015-05-0118-0/+211
| | | | | | | | | | Each test needs to have its own package because pos_all will try to compile the whole valueclasses directory at once.
* | Erasure: properly handle null in value classesGuillaume Martres2015-05-011-0/+27
|/ | | | This fixes the issues reported in SI-5866 and SI-8097
* Merge pull request #500 from dotty-staging/implement/i499Dmitry Petrashko2015-04-301-0/+15
|\ | | | | Implement/i499
| * Add test for by-name varargsMartin Odersky2015-04-251-0/+15
| |
* | Disable failing tests. See #503Dmitry Petrashko2015-04-302-28/+0
| |
* | Add a test for a deferred object in interface.Dmitry Petrashko2015-04-301-0/+6
| |
* | Merge pull request #495 from dotty-staging/refactor/SuperAccessorsDmitry Petrashko2015-04-281-0/+7
|\ \ | | | | | | Refactor/super accessors
| * | Drop restriction that SuperAccessors should not touch patternsMartin Odersky2015-04-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not sure why we need to do this, and in any case it's not sure what constitutes a pattern. There are certainly some parts of patterns (e.g. prefixes of unapplies, or their implicit arguments) that should be transformed under SuperAccessors, so the previous condition was too coarse. We include the test case that motivated the restriction. It looks like it works now.
* | | Merge pull request #498 from dotty-staging/save-tastyDmitry Petrashko2015-04-282-0/+26
|\ \ \ | |_|/ |/| | Save TASTY in attribute of classfiles.
| * | Allow separate compilation of Dotty using TASTYMartin Odersky2015-04-252-0/+26
| |/ | | | | | | | | Classfile parser now reads TASTY attributes or annotations and unpickles them in order to allow for separate compilation.
* | Add a neg test for SAMs.Dmitry Petrashko2015-04-231-0/+1
| |
* | Fix #492. Traits that require an outer pointer are not SAMs.Dmitry Petrashko2015-04-231-3/+9
|/
* Fix #342 Lambda lift idents need to get new prefixMartin Odersky2015-04-171-0/+10
| | | | | Idents of lifted symbols become class members, need to carry the right reference with the right prefix as type.
* Improve documentation and minimze testMartin Odersky2015-04-172-0/+19
| | | | | | | Documentation around markFree and narrowLiftedOwner was added. i480 was minimzed and dependencies on dotc were removed. (+1 squashed commit) Squashed commits: [1a84054] Test cases for #480
* Ensure spaces after `if` in Dotty tests.Dmitry Petrashko2015-04-091-1/+1
|
* Add spaces around + in tests.Dmitry Petrashko2015-04-097-20/+20
|
* Remove trailing spaces in Dotty tests.Dmitry Petrashko2015-04-0911-50/+50
|
* Replace tabs with 4 spaces in Dotty tests.Dmitry Petrashko2015-04-0931-88/+88
|
* Make all dotty tests end in newlineDmitry Petrashko2015-04-0911-11/+11
|
* Backend: Emmit simple annotationsDmitry Petrashko2015-04-032-0/+14
|
* Merge pull request #425 from smarter/fix/isNullableClassodersky2015-03-261-0/+11
|\ | | | | Fix isNullableClass to also work after Erasure
| * Fix isNullableClass to also work after ErasureGuillaume Martres2015-03-231-0/+11
| | | | | | | | | | | | | | | | | | | | Incidentally this means that: val d = null.asInstanceOf[Double] is now correctly transformed to: val d = scala.Double.unbox(null) Previously it was translated to: val d = null: Double Which is wrong and fails in the backend.
* | Merge pull request #428 from dotty-staging/trait-constructorsDmitry Petrashko2015-03-251-12/+12
|\ \ | | | | | | New phase: trait constructors
| * | Fix failing tets: test instantiated abstract traits.Dmitry Petrashko2015-03-251-12/+12
| |/
* / Fix #429Martin Odersky2015-03-251-0/+3
|/ | | | enclosingMethod should not crash on NoDenotation.
* Pickling test reorgMartin Odersky2015-03-1821-813/+0
| | | | | | | | Move pickling tests into separate top-level test directory. That way they are not needlessly pos-tested before. Also, disable core tests for now - after rebasing we get a stale symbol error. Need to investigate that.
* Pickle shadowed namesMartin Odersky2015-03-181-1/+2
| | | | | | | | | Shadowed names in types need to be pickled and treated on unpickling. We choose to make Shadowed a separate TastyName class, to avoid the ad-hoc name-mangling in current dotc. When names are redone Shadowed will also become a special class in the compiler proper.
* Deal gracefully with out-of-scope references wehn unpicklingMartin Odersky2015-03-181-0/+65
| | | | | | | | | | | | | | | Out-of scope references are evil but do arise. Dotc currently produces them in two cases (t1957.scala and Typer.scala) because it does not correctly hygenize dependent methods used as closurs. I beleive scalac wil generate them in more instances. The changes can produce dependent method types used in closures. Essentially the problem was that the depndency was not recognized in Typers when the closure was first created, because it badly interfered with type inference. But when unpickling the same closure the dependency is recognized. It's too late to fail now, we better deal with this gracefully. That's why there is now a mode bit "AllowDependentFunctions" which should be turned on only for unpickling, which reconstitutes dependent functions as closures without complaining.
* More testsMartin Odersky2015-03-188-0/+217
| | | | Both some long overdue pos tests and more pickleOK tests
* Fix TastyReader#readLongIntMartin Odersky2015-03-181-0/+33
|
* Compute PureInterface flag after pickling.Martin Odersky2015-03-188-0/+399
| | | | | | | | | | ElimLocals becomes a slightly less trivial transform: NormalizeFlags. It also computes PureInterface flag, thus relieving Namer and Unpickler from doing the same in two different ways. Besides, the computation in Namer/TreeInfo was flawed because it did not take into account that nested non-static classes are not allowed in an interface (only static classes are, but these would not be members of the interface in the Scala sense).
* Allow several units to be pickle-tested at once.Martin Odersky2015-03-186-0/+155
| | | | | | | | Also: Make Pickler a plain phase; it is neither a macro transformer nor a miniphase. Add tests to pickleOK that are known to be stable under pickling/unpicking by comparing tree representations via show.
* Better tracking of unhygienic closure typesMartin Odersky2015-03-181-2/+27
| | | | | | | | We have two unhygienic closures left - one in t1957.scala the other in Typer.scala. This commit leaves some printlns that can be uncommented to get more info on these. It would be better to fix them but I am running out of time to do so. Maybe someone else can pick up with the info this commit allows to recover. To find out more, go to t1957.scala and read the comment.
* Avoid dependent methods being closures.Martin Odersky2015-03-181-0/+12
| | | | | We now make sure that a closure's result type does avoid references to parameter types.