aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Exclude inaccessible definitions from contextual implicit search.Martin Odersky2014-01-062-2/+5
|
* Make implicit scope work in the presence to TypeVarsMartin Odersky2014-01-063-55/+76
| | | | Need to pass a current context to be able to find instances of typevars.
* Make Settings.scala dotty conformantMartin Odersky2014-01-062-3/+6
|
* Propagate constraints on result type eagerly into implicit search.Martin Odersky2014-01-044-24/+24
| | | | Thus constraining the search space.
* Changes to propagation of wildcardtypesMartin Odersky2014-01-042-5/+7
| | | | | | 1) Selecting from a wildcardtype now gives a wildcard type. Wildcard types are no longer legal as prefixes of NamedTypes. 2) Bound of type variables are proagated into wildcard type approximations.
* Output cleanupsMartin Odersky2014-01-047-9/+15
|
* Fix prinitng of pattern guards in treesMartin Odersky2014-01-041-1/+1
|
* Fix in constrainResultMartin Odersky2014-01-043-2/+6
| | | | | | | | | | Need to handle the case of a curried method with result type (Ts)T and expected type Ts => T
* Add AnyRef parent for case classes that do not have an extends clause.Martin Odersky2014-01-042-3/+5
| | | | Previously, such classes just had ProductN as parent, which is not a subtype of AnyRef.
* Make anonymous methods non-dependent where possible so that they can be used ↵Martin Odersky2014-01-043-12/+16
| | | | in closures.
* Generalize overloading resolution to type arguments.Martin Odersky2014-01-044-30/+49
| | | | | 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.
* Hardening against a possible NoDenotation has no owner crash.Martin Odersky2014-01-031-1/+1
|
* 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).