aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* typeArgs should return TypeBounds for a wildcard type.Martin Odersky2014-01-031-1/+1
|
* Avoid premature caching of baseClasses and superclass bits.Martin Odersky2014-01-031-8/+12
| | | | This can happen while classParents is set to Nil in Namer#classSig. Any call to baseClasses and superClassBits during that time needs to bypass the cache.
* Fix printing of wildcard types.Martin Odersky2014-01-031-3/+17
|
* Making namedPartsWith more robust.Martin Odersky2014-01-032-3/+7
| | | | When called from implicitScope, we formed an AndType with a WildcardType. No problem, except that this broke the AndType assertion. The assertion is not needed for this sepcial case.
* Don't print module class suffix in refined printer.Martin Odersky2014-01-031-6/+3
|
* Drop module class suffix when looking for class with enclosing name.Martin Odersky2014-01-031-6/+10
| | | | E.g. in privateWithin.
* Making printing configurable.Martin Odersky2014-01-037-37/+60
| | | | Special by-topic printers that can be turned off.
* safeUnderlyingTypeParams now forces uncompleted symbols.Martin Odersky2014-01-034-14/+17
| | | | When removing logging, it turned out that Coder no longer compiled. The problem was tracked to safeUnderlyingTypeParams which did not force enough.
* Fixing a type problem where code does not compile under dotty.Martin Odersky2014-01-023-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and I believe should not compile under Scala2x either. The problem is in line 361 of TreeInfo.scala methPart(tree) match { ... Here, tree: tpd.Tree methPart: (tree: this.Tree): Tree So we need to show that tpd.Tree <: this.Tree LHS expands to ast.Tree[Type] RHS expands to ast.Tree[T] where T >: Untyped is TreeInfo's type parameter Since Tree is contravariant, we need to etablish T <: Type but I see nothing that could prove this. The Dotty typechecker detected the problem, yet Scala2x's didn't. Need to follow up on why not. For now, adding the necessary constraint to the codebase.
* Tweak to isFullyDefinedMartin Odersky2014-01-021-2/+14
| | | | The isFullyDefined accumulator will now maximize variables which are contravariant in the type, rather than minimizing them. Fits better in the general scheme and makes a pattern match in TreeInfo go through.
* Some cleanups.Martin Odersky2014-01-023-3/+5
|
* Taking a fully-defined result type into account when forming a closure.Martin Odersky2014-01-022-5/+5
| | | | | | | | | | | | | | Given (params) => body and an expected type Ts => R with R fully defined, we use R as the result type of the closure def into which the function is translated. Note: It would be nice generalize this further to result types which are not fully defined, yet this would complicate things by entangling typing and desugaring.
* Fixing a problem with isFullyDefinedMartin Odersky2014-01-021-4/+6
| | | | When forceDegree == None, a TypeVar should trigger a false result.
* Fixing problems with wrong ownerMartin Odersky2014-01-021-6/+10
| | | | ... which were introduced when trying to avoid NoSymbol owners.
* Propagating fully defined result types into closures.Martin Odersky2014-01-021-6/+10
| | | | | | | | | | Given a function (params) => body If the expected type is Ts => T and T is fully defined, desugar to a closure with given result type T. Note, it's tempting to generalize this further to non-fully defined result types, but then we cannot do clsoure expansion during unsugaring, and things would get complicated.
* Making Desugar.scala dotty-conform.Martin Odersky2014-01-022-2/+5
|
* Ensuring that contexts do not have NoSymbol as owner.Martin Odersky2014-01-022-4/+8
|
* Avoiding a crash in denot-union.Martin Odersky2014-01-021-1/+1
|
* Avoiding converting with a view to a TypeVarMartin Odersky2014-01-021-1/+1
| | | | This triggered an assertion violation in ImplicitSearch. When checking an argument for a method, it's possible that the method parameter is a lower bound, and the argument is incompatible with that lower bound. In this case an implicit conversion towards the variable was searched, which leads to an explosion of the search space (the variable expands to WildcardType, so _every_ implicit is eligible). Better to search for a conversion to the lower bound (or, in fact, and equivalently, the underlying type parameter) instead.
* Better error message for accessibility errors.Martin Odersky2014-01-021-3/+3
|
* More precise widening of types referring to a block-local.Martin Odersky2014-01-014-23/+24
| | | | | | The new scheme widens termRefs everywhere variance is positive and type-aliases over termrefs everywhere indepdendent of variance. Needed to add variance to TypeMap to make this work.
* Constraints need to be ignored when forming lubs and glbs of constrained ↵Martin Odersky2014-01-012-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | 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!
* Reverting a change in `tpd` that would no longer be type-correct under dotty ↵Martin Odersky2014-01-013-2/+12
| | | | | | rules. (reverted from commit 50ab9f559ad36b916d24e733df3629994d239583) We now admit `identity _` and, if the expected type is a function type, pass this type on to the function. If the expected type is not a function type, we pass on AnyFunctionProto.
* Revert "Reverting a change in `tpd` that would no longer be type-correct ↵Martin Odersky2014-01-011-1/+1
| | | | | | under dotty rules." This reverts commit 50ab9f559ad36b916d24e733df3629994d239583.
* Better assertions and diagnostics in TypeComparers.Martin Odersky2013-12-312-4/+8
|
* Reverting a change in `tpd` that would no longer be type-correct under dotty ↵Martin Odersky2013-12-311-1/+1
| | | | rules.
* Check that constraints are not cyclic, and avoid cycles when replacing ↵Martin Odersky2013-12-313-16/+58
| | | | parameters.
* Avoiding search for companion module if class in question is anonymous.Martin Odersky2013-12-311-1/+1
| | | | This can prevent cyclic references during implicit search.
* Combining AndType, OrType into common Trait.Martin Odersky2013-12-311-2/+7
| | | | Still need to explore where we can use this (one usage will be in TypeComparers).
* Adding dotty.Predef to root importsMartin Odersky2013-12-313-11/+16
| | | | We need to have a place where to put (yet to be implemented) classTag/typeTag macros, which will replace the custom search for tags in Scala2x
* Adding a prototype of the right-hand side of default-getters.Martin Odersky2013-12-313-11/+66
|
* Fixing the type of a named self reference.Martin Odersky2013-12-313-3/+15
| | | | | | | | | | This was previously C.this.self but it should be C.this
* Upgrades to handle subtyping between parameterized and higher-kinded types.Martin Odersky2013-12-314-10/+68
|
* Adding a new case to subtype tests.Martin Odersky2013-12-291-8/+19
| | | | | | | This one handles situations like val sym: Symbol sym.type <:< Symbol { type ThisType = sym.ThisType }
* Tightening of position handlngMartin Odersky2013-12-295-6/+15
| | | | | | | 1) endPos works now even for NoPosition. 2) On the other hand, there's an assertion in Typer.typed which requires every non-empty tree that's type checked in a globally committable context to have a defined position. Some fixes were needed to make the tests pass the new assert.
* Avoiding an idiom which is not supported by dotty.Martin Odersky2013-12-291-1/+1
| | | | | Normally, Predef.identity cannot be used as an expression with unknown expected type. You need a trailing `_`. But when used as a default argument, Scala 2x allows it. I am not sure why it is allowed. In dotty it's disallowed everywhere, hence the fix.
* Fixing a problem where constrictors forgot that parameters are implicit.Martin Odersky2013-12-281-1/+1
|
* New version of eta-expansion.Martin Odersky2013-12-285-38/+97
| | | | | | | | 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).
* Fixing off-by-one error for SourcePosition#lineMartin Odersky2013-12-271-1/+1
|
* Avoiding redundant tuple formations.Martin Odersky2013-12-272-1/+17
| | | | | | | | | | | | In a case like val (x, y) = if (...) (a, b) else (c, d) we can pass the tuples directly. Previously, this would have been translated to val (x, y) = (if (...) (a, b) else (c, d): @unchecked) match { case (s, t) => (s, t) }
* Fix to blockType for automatic widening.Martin Odersky2013-12-261-3/+21
| | | | Need to apply widening within types, not just at toplevel.
* Module classes are now entered into owner's scope when unpickled.Martin Odersky2013-12-263-3/+4
| | | | ... aligning with treatement of module classes elsewhere.
* Fixing unpickling of refinements.Martin Odersky2013-12-262-3/+10
|
* Fixing a bug which arose for class denotations that were absent.Martin Odersky2013-12-251-0/+1
|
* Avoiding auto-unit insertion.Martin Odersky2013-12-253-4/+4
| | | | (vecause dotty can't do it).
* New testMartin Odersky2013-12-252-1/+4
|
* Small tweak to LRU-cache.Martin Odersky2013-12-251-1/+2
|
* Fix for caching of denotsNamed.Martin Odersky2013-12-251-3/+10
| | | | The problematic scenario is when a member is looked up between the point where a class is provisionally completed with Nil as parents and a class is finally completed. In that case we might miss a parent ref, which should then not entered in the cache.
* Fix to computeNPMembersNamed.Martin Odersky2013-12-252-4/+9
| | | | Also, added logic for cache consistency checking for membersNamed.
* Making the name of self visible inside a class.Martin Odersky2013-12-252-1/+24
| | | | Previously, it wasn't.