aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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-1/+1
| | | | | | | | 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.
* Change scheme of translating array creations new Array(...)Martin Odersky2015-03-181-1/+2
| | | | | | | | | | The previous scheme generated too many newGenericArray expressions because at the time newArray was called, the type arguments were not yet determined. Furthermore, the type variables somehow did not have the right positions, which caused them not to be interpolated and led to orphan PolyParams. The new scheme converts the expression when the length parameter has been supplied and it fully determines the array type before converting.
* Disallow refinements of types or methods that do not appear in parent.Martin Odersky2015-03-1811-77/+89
| | | | | | | | We planned this for a long time but never implemented it. Instead, we sometimes issued an erro in Splitter, namely if reflection would have been needed to access the member. It turns out that some tests (e.g. neg/t625) fail -Ycheck (we knew that before and disabled) but also fail Pickling because they generate orhpan PolyParams. So rather than patching this up it seems now is a good time to enforce the restriction for real.
* Merge pull request #404 from dotty-staging/backend-mergeDmitry Petrashko2015-03-181-0/+17
|\ | | | | Fixes to erasure, backend, flatten, restorescopes,
| * Handle boxing inside labels, jump back to box.Dmitry Petrashko2015-03-181-0/+17
| | | | | | | | | | Erasure inserts boxing and unboxing of label returned values, ignoring the fact that some labels do not return. Now this is taken into account also inside labels which refer labels themselves
* | Merge pull request #407 from dotty-staging/fix/#400odersky2015-03-131-0/+13
|\ \ | | | | | | Fix #400
| * | Fix #400Martin Odersky2015-03-131-0/+13
| |/ | | | | | | In a call-by-name arg, replace () => f.apply() with f only if f is pure.
* | Merge pull request #408 from dotty-staging/test/#390Dmitry Petrashko2015-03-131-0/+0
|\ \ | | | | | | New test for valueclasses
| * | New test for valueclassesMartin Odersky2015-03-131-0/+0
| |/ | | | | | | | | | | Re-instantiated t2667.scala, which failed before because of issue #390. Also changed order of tests in isDerivedValueClass, to make more disriminating test come first.
* / add/strictMartin Odersky2015-03-132-0/+0
|/ | | | | | | | | | | Add -strict option to do some type checks that are encessary to ensure type soundness, but are stricter than what Scala 2.x enforces. The first such test is the "pattern cannot be uniquely instantiated" problem where we reject a non-variant case subclass of a covariant superclass in a pattern match. The error is now only issued in -struct mode, otherwise it will be a warning. We might move more tests into the same category. This should help the transition.
* Merge pull request #383 from smarter/fix/fullyParameterizedDefDmitry Petrashko2015-03-051-0/+1
|\ | | | | FullParameterization: fix rewiring of Returns
| * FullParameterization: fix rewiring of ReturnsGuillaume Martres2015-03-021-0/+1
| | | | | | | | | | The `from` field of a Return tree should either be EmptyTree or an Ident corresponding to the method we're returning from.
* | Fix bug which prevented New over type-instantiated aliases.Martin Odersky2015-02-281-0/+8
|/ | | | | | | | | | | Previously, type Map = HashMap[Int, String] new Map did not work. See test aliasNew.scala for a test. Formerly this logic handled in Parsers (wrapNew), but that one does not work for aliastypes.
* Fix tests/pos/{i143,extmethods}.scala: value classes must have exactly one ↵Guillaume Martres2015-02-152-4/+2
| | | | val param
* Merge pull request #359 from dotty-staging/fix/erasure-lub-alternativeDmitry Petrashko2015-02-131-0/+27
|\ | | | | Fix/erasure lub alternative
| * Insert correct boxing/unboxing conversions for branchesMartin Odersky2015-02-111-0/+27
| | | | | | | | ... of an If, Match, or Try. Fixes #355.
* | Merge pull request #358 from dotty-staging/backend-backportsDmitry Petrashko2015-02-122-0/+2
|\ \ | | | | | | Backend discovered issues
| * | Disable t2669 dies in Classfile parser while parsing ↵Dmitry Petrashko2015-02-111-0/+1
| | | | | | | | | | | | java.util.Vector(requested by backend)
| * | Disable t2667 that fails inside Extension methods.Dmitry Petrashko2015-02-111-0/+1
| |/ | | | | | | This info transformation was left untriggered before backend was enabled.
* | Prevent block types with references to local symbolsGuillaume Martres2015-02-112-0/+19
| |
* | Java methods: JavaMethodType instead of MethodType, convert Object to AnyOndrej Lhotak2015-02-072-0/+0
|/ | | | | | | | | | Fixes two bugs needed for java-override test: Namer was creating a MethodType instead of a JavaMethodType even though the JavaDefined flag was set on the DefDef. Following Scalac, Namer needs to convert Java method parameters of type j.l.Object to s.Any.
* New failing testMartin Odersky2015-02-072-0/+10
| | | | As noticed by @retronym, Any and Object are not identified when matching Scala and Java methods. I believe this is because the Java method does not have the Java flag set. @olhotak can you take a look?
* More negative override testsMartin Odersky2015-02-071-0/+14
|
* New spec and implementation for matching.Martin Odersky2015-02-071-0/+8
| | | | | Reformulated matchign spec and implemented accordingly. Previous fix for #329 would have missed third new error case in over.scala.
* Fix of #329.Martin Odersky2015-02-071-0/+7
| | | | Overriding pairs needs to match ExprTypes with field types. Closes #329.
* Test reorgMartin Odersky2015-02-0718-61/+58
|
* Fixes handling of op-assignments for polymorphic apply/update.Martin Odersky2015-02-071-0/+0
| | | | See t3252 for a test case.
* Merge pull request #346 from dotty-staging/local-lazy-valsodersky2015-02-071-0/+16
|\ | | | | Bring back lazy vals. Changed encoding scheme of local(non-field) lazy vals
| * Fix problems with lazy vals and separate compilationDmitry Petrashko2015-02-031-0/+16
| | | | | | | | | | Somehow this error manifested itself in a quite weird way during erasure. So it was hard to track down
* | Addressing review comments of #336Dmitry Petrashko2015-02-031-1/+1
| |
* | Even more careful handling of tailcalls.Dmitry Petrashko2015-02-031-5/+21
| | | | | | | | See i321 doc for description of problem and decision taken.
* | Fix i321, tail call needs to be careful with abstracting over class type ↵Dmitry Petrashko2015-02-031-0/+10
|/ | | | | | arguments. Or it could lead to Ycheck error that was triggered in #321.
* Merge pull request #338 from dotty-staging/fix/t3152-findMemberodersky2015-01-3110-0/+38
|\ | | | | Fix/t3152 find member
| * New testsMartin Odersky2015-01-2710-0/+162
| |
| * Use normnalized type to report type errors.Martin Odersky2015-01-278-124/+0
| | | | | | | | | | | | | | | | | | Without it, we get strange error messages like found: (implicit X)Y requred: Z when the problem is really that Y is not a subtype of Z.
* | Merge pull request #331 from dotty-staging/fix/refined-subtypingodersky2015-01-3114-67/+71
|\ \ | | | | | | Fix/refined subtyping