aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #61 from odersky/fixes-t00xxodersky2014-03-123-0/+16
|\ | | | | Fixes t00xx
| * Fix constructor completion problem detected in t0054Martin Odersky2014-03-121-0/+4
| | | | | | | | | | | | | | | | | | Constructors need to be completed in the context which immediately encloses a class. Otherwise type references in the constructor see the wrong types, as is demonstrated in t0054. The difficulty here is that the inner class B nested in A also extends from A. Then it makes a difference whether the constructor parameter types of B are resolved in the context of B or in the context of A. Added explanation for context handling of constructors.
| * Fix problems related to t0039Martin Odersky2014-03-101-0/+6
| | | | | | | | | | | | | | | | | | | | | | This test case exercised several problems: 1.)2.) Two ways to run into a cyclic references. Fixed by - assuming an early info when completing a typedef, similarly to what is done for a classdef - doing wellformed bounds checking in a later phase. Failure to check whether arguments correspond to F-bounds. - a substitution was missing.
| * Fix for t1002Martin Odersky2014-03-101-0/+6
| | | | | | | | | | Need to compile the self type of a class not in the context of the class members but one context further out. Reason: self type should not be able to see the members.
* | Merge pull request #60 from odersky/fix/#50-volatileodersky2014-03-121-0/+25
|\ \ | |/ |/| Fix/#50 volatile
| * Fix of #50 - volatileMartin Odersky2014-03-091-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Volatile checking needs to take all intersections into account; previously these could be discarded through needsChecking. Plus several refactorings and additions. 1) Module vals now have Final and Stable flags set 2) All logic around isVolatile is now in TypeOps; some of it was moved from Types. 3) Added stability checking to Select and SelectFromType typings. Todo: We should find a better name for isVolatile. Maybe define the negation instead under the name "isRealizable"?.
* | Improve test infrastructureMartin Odersky2014-03-101-264/+0
|/ | | | | | | | | 1) New method compileFiles which allows one to compile the content of a directory one file or directory after another. 2) max constraint is printed to typr. Added new test pos_all. Other pos tests can be retired.
* Removed useless ValDef flagged by @samuelgruetter in previous pull requestMartin Odersky2014-03-071-0/+18
|
* Fix of #39Martin Odersky2014-03-042-0/+36
| | | | | | | | Two fixes: 1) Avoid the infinite recursion in checkAccessible if the accessibility check fails. 2) Make accessibility succeed for the test, and in general if the target denotation does not have a symbol. Added original test in pos and a negative test which makes accessibility fail.
* Typos corrected.Dmitry Petrashko2014-03-031-1/+1
| | | | | More verbose assertions. Unnecessary semicolons removed.
* Rename baseType -> baseTypeRefMartin Odersky2014-03-021-0/+21
| | | | | | | What was `baseType` and is now `baseTypeRef` only computes the prefix of of basetype, not the type arguments. If type arguments need to be included there is `baseTypeWithArgs`. The reason is that type arguments are usually already encoded as member types. But this was a source of errors because in Scala 2, baseType includes the type arguements. (also added test file structural.scala forgotten from last commit)
* Check that inferred parent classes are feasible.Martin Odersky2014-03-012-5/+21
|
* Reorganization of template parents.Martin Odersky2014-03-013-0/+32
| | | | | | | | | | | Template parents always were constructor calls before. This is not correct because in a situation like the one elaborated in templateParents, the trait D has the class C as supertype, but it does not call its constructor (in fact, if we added a () parameter list to make it into a constructor this would be wrong because C takes parameters. Now parents can be either types or constructor calls. The logic in Namer and Typer that deals with parents is cleaned up. In particular, we now construct any synthetic class parent as a full type, before calling normalizeToClassRefs. This obviates the forwardRefs logic that needed to be done in a cleanup of Namers. Also added two more checks: (1) All parents except the first one must point to traits. (2) A trait may not call a parent class constructor.
* Discard inaccessible denotations when merging.Martin Odersky2014-02-241-5/+3
| | | | | | | | | | | When froming the &=merge of two denotations, we now discard denotations which have inaccessible symbols. The reason for this change is that, without it, the following code gives the warning "cannot merge Int and Int() as members of one type, keeping only Int()". val m = new java.util.HashMap m.size Indeed java.util.HashMap has a filed and method which are both named size. The field is package private, so is inaccessible from outside java.util, however.
* Generalize test infrastructureMartin Odersky2014-02-071-1/+0
| | | | Compiler tests can now be run with configurable number of compilers and runs in a compiler.
* Fix bug for reading type arguments in ClassfileParserMartin Odersky2014-02-061-7/+4
|
* Commenting out unused alternative isSubType implementation.Martin Odersky2014-02-031-5/+9
|
* Fix problems with TypeVar instantiationMartin Odersky2014-02-031-0/+3
| | | | | 1) Simplify skipped one level over arguments of AndType/OrType. 2) variances needs to follow instantiated typevars
* Relaxing check that implicits must have explicit return typeMartin Odersky2014-02-021-1/+1
| | | | | | Now this is required only for members of a template. Local statements can still have implicits with no result type. (Maybe we need to get back on this). Also, changed Dotty itself and tests to adhere to the new restriction.
* Improve eligible caching in implicit search.Martin Odersky2014-02-021-0/+11
| | | | Improves effectiveness of elidable cache from ~66% to ~85% and reduces # of implicits that need to be checked after discarding to about 20% what it was before.
* Avoid accessing implicits that come from root imports that are hidden by ↵Martin Odersky2014-02-021-1/+1
| | | | | | | | | | | | some nested import. This also changes the criterion when a root import is disabled. A root import is now disabled if there is an inner import from the same package or module, and the inner import contains at least one disabling clause X => _. (The latter crierion is new; without it, we would consider something like import scala.{collections => c} as a hiding import for Scala, which seems to go too far.)
* Fix checking for disabled root importsMartin Odersky2014-02-021-0/+11
| | | | Needs to be done always when hitting a wildcard import, not just when something was found
* Fixes to constraint handling.Martin Odersky2014-01-262-1429/+225
| | | | | | | | In particular, need to unify polyparams before replacing one with the other, if the result wiould lead to a cyclic constraint. Also: Avoid setting `inst` field of a type variable if a subtype operation is in progress, because the constraint might be retracted, and the instantiation should be retracted with it. Third, tighter checks of cyclic constraint, and deep subtype recursions can now be demanded to cause an abort.
* Make better use of AndOrTypes.Martin Odersky2014-01-201-26/+1452
|
* Normalize parent types so that first one always refers to a class, not a trait.Martin Odersky2014-01-191-4/+12
| | | | Also: forward type parameter references of newly added to class scope. This is necessary, or the pattern match in test.scala would fail. Need to find out why.
* Refinement of fully-defined accumulator.Martin Odersky2014-01-192-167/+24
| | | | It needs to follow type aliases in order not to give false indications what variables are contained in a type.
* Fix to computation of implicit scopesMartin Odersky2014-01-181-111/+148
| | | | For packages, the implicit scope consists of the implicit definitions in a nested `package` object, not the package itself.
* Fix isWildcardStarArg test so that it works also for typed trees.Martin Odersky2014-01-181-0/+6
|
* More tests.Martin Odersky2014-01-181-0/+6
|
* Refine avoiding local refs in block's type.Martin Odersky2014-01-181-494/+102
| | | | If all else fails, force all type variables with fullyDefinedType. This can avoid references to locals. Example in file dotctest: SourceFile.scala, method calculateLineIndices.
* Tweak to typing of function values.Martin Odersky2014-01-151-7/+14
| | | | We now propagte the expected function result type (if it exists) into the function body even if it not fully defined.
* Fix typing of unapplySeq extractor arguments.Martin Odersky2014-01-151-1/+12
| | | | Needed a special case for them.
* Making some traces conditional on printers being enabled.Martin Odersky2014-01-131-0/+6
|
* Better reporting of cyclic references involving imports.Martin Odersky2014-01-111-262/+452
| | | | Used to be "cyclic reference involving val <import>". Now prints import statement that caused the error.
* Add a constructor to class Any, so that it can be inherited.Martin Odersky2014-01-101-0/+337
|
* New subtype constraint maintenance algorithm.Martin Odersky2014-01-071-0/+5
| | | | | | | | | | Objective: Avoid cycles by detecting all cases where A <: B and B <: A and removing those cases by unifuing A and B. Cycles need to be avoided because they lead to deep subtype recursions.
* Fix to overloading resolution: prioritize non-methods over methods.Martin Odersky2014-01-061-1/+3
| | | | If one alternative is a non-method yet the other is a method (of type PolyType or MethodType), the first alternative is "as specific as" the second.
* Generalize overloading resolution to type arguments.Martin Odersky2014-01-041-1/+4
| | | | | We need to take type arguments + value arguments into account when there are several overloaded alternatives that are all polymorphic and can be instantiated with the type arguments.
* Constraints need to be ignored when forming lubs and glbs of constrained ↵Martin Odersky2014-01-011-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | oarameter bounds. Otherwise we would get into situations like the following (experienced in typers.Arrays): Constraint: B >: String T >: B Add B >: T to this constraint. You get: B >: String | T, but because T >: B >: String, the rhs reduces to B >: T Simplified this gives B = T and the String lower bound has vanished!
* Adding a prototype of the right-hand side of default-getters.Martin Odersky2013-12-311-3/+12
|
* Upgrades to handle subtyping between parameterized and higher-kinded types.Martin Odersky2013-12-311-0/+35
|
* New version of eta-expansion.Martin Odersky2013-12-281-0/+4
| | | | | | | | This version expands a method ref p.m to the untyped tree p.m(_, ..., _) (after lifting impure expressions from p). Afterwards the usual application mechanisms kick in. This fixes problems also present in Scala 2.x, where an eta-expanded function was not as flexible as an explicitly expanded one (for instance, eta expansion did not honor default parameters).
* Making the name of self visible inside a class.Martin Odersky2013-12-251-0/+17
| | | | Previously, it wasn't.
* Fixing problems in treatment of private symbolsMartin Odersky2013-12-241-0/+15
| | | | | | | | | | | | 1) Accessibility check was broken because it looked at symbol's owner, where it should have looked at context owner. 2) Refined treatement if members. Previously, nonPrivate member returned a subset of member, i.e. those denotations returned by member that were not private. This is not correct. In a situation like class A { def x: Int = 1 } class B { private def x: String = "" } extends A (new B).x the non-private member returned should be A#x. Changed membersNamed and friends as well as checkAccessible to account for that.
* Handling implicit unapply arguments.Martin Odersky2013-12-201-0/+8
| | | | Changed format of UnApply nodes to also take implicit parameters. See doc comment in class Trees.UnApply
* Making sure New's always end in an application.Martin Odersky2013-12-181-0/+12
|
* Special handling of implicit members.Martin Odersky2013-12-171-0/+10
| | | | | The previous treatment would force all members, causing cyclic reference errors. We fix it by filtering early in computeMemberNames itself for implicits.
* Fixes for by-name argumentsMartin Odersky2013-12-171-1/+14
| | | | Previously, we did not strip off the => when comparing against expected type.
* Fixes to desugaring and indexing package objectsMartin Odersky2013-12-172-0/+9
| | | | Plus some small tweaks in Typer
* Small tweaks to typerMartin Odersky2013-12-161-4/+7
|