aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Change to computing arguments in a pattern match.Martin Odersky2013-12-192-2/+5
| | | | | | | | | Previously, if the result of an unapply arg type is a type with isDefined and get methods, we proceed as follows: if the get result type is a product: take the produce argument types otherwise take the get result type itself The problem is if the get result type is an empty product. We solve this by demanding that the get result type is a ProductN type, not just a subclass of product.
* 3 changes to implicit searchMartin Odersky2013-12-192-6/+15
| | | | | | | | 1. Shadowing tree uses adaptation funProto of prototype. Previously many shadowing tries failed with errors like "need to follow with "_" to adapt to function". These early failures hid potential shadowing conflicts. 2. Shadowing conflict testing is now done using symbols instead of comparing references. Comparing references gave false negative when a shadoing tree had inferred type parameters, for instance. There were other problems as well. Generally, comparsing references seems too fragile. 3. Inferred views are now re-adapted. This is necessary if the view itself takes another implicit parameter.
* Following type aliases when pattern matching.Martin Odersky2013-12-193-15/+78
| | | | | | | | | | | | | | | Faced with a pattern like Apply(x, xs) we first look for an Apply object which is an extractor. If this fails, we now interprete Apply as a type. If it is a type alias which points to a class type that has a companion module, we then try that companion module as an extractor. Scala 2.x does ot that way, and it's used widely within dotty itself. Think tpd.Apply as the found object, Trees.Apply as the extractor. Also, added a fix to normalization which made normalization go deep into a method type.
* Fixing a typo in mergeDenots.Martin Odersky2013-12-181-1/+1
|
* Allowing curried closures.Martin Odersky2013-12-182-3/+2
|
* Making sure New's always end in an application.Martin Odersky2013-12-184-5/+22
|
* Fixes to parent types.Martin Odersky2013-12-172-5/+9
| | | | The previous addition of checkClassTypeWithStablePrefix to Namer#classSig needs to be adjusted.
* Special handling of implicit members.Martin Odersky2013-12-174-4/+21
| | | | | The previous treatment would force all members, causing cyclic reference errors. We fix it by filtering early in computeMemberNames itself for implicits.
* Three bugfixes to typing.Martin Odersky2013-12-175-11/+14
|
* Fixes for by-name argumentsMartin Odersky2013-12-176-15/+30
| | | | Previously, we did not strip off the => when comparing against expected type.
* Two fixes in TyperMartin Odersky2013-12-171-3/+6
| | | | | | | Fixes for var x: T = _ super.f(...)
* Fixes to desugaring and indexing package objectsMartin Odersky2013-12-176-21/+35
| | | | Plus some small tweaks in Typer
* Bringing isFunctionType in line with isTupleTypeMartin Odersky2013-12-171-3/+6
|
* Eliminating StateFulMartin Odersky2013-12-162-23/+17
| | | | Was only needed as a parameter to a continuation, so it seemed easier to just pass the components directly.
* Small tweaks to typerMartin Odersky2013-12-163-9/+13
|
* Better handling of cyclic reference errors.Martin Odersky2013-12-168-3/+61
|
* Fix in printing RefinedTypesMartin Odersky2013-12-161-1/+1
|
* Negative typer tests.Martin Odersky2013-12-161-0/+41
|
* Checking for double definitions among class definitions.Martin Odersky2013-12-168-45/+73
| | | | | | Also fixes to typedReturn. Adapted tests accordingly.
* Default arguments now have a positionMartin Odersky2013-12-161-1/+6
|
* Fix to prompting.Martin Odersky2013-12-161-4/+3
|
* Setting Method flag when parsing classfiles and sourcesMartin Odersky2013-12-162-2/+3
|
* Making Method a fromStartFlagMartin Odersky2013-12-163-5/+6
|
* Small cleanups to scanning and parsing.Martin Odersky2013-12-163-25/+17
|
* Check for no double defsMartin Odersky2013-12-161-1/+4
| | | | | Added check for double def if owner of scope is not a class. For class members we will need a more refined check. One way to do it is to immediately rule out doubly defined members with same signature.
* Fix to desugaring refinement types.Martin Odersky2013-12-163-3/+35
|
* Fixes to typed return, try, match.Martin Odersky2013-12-163-18/+21
|
* Fixes related to SAM types.Martin Odersky2013-12-157-26/+51
| | | | | | | 1. Changes to SAMType extractor 2. Self names are no longer members of enclosing class 3. SAM-Type closures now print with their result type. 4. refactoring newSkolemSingleon ==> narrow
* Fixed several deep problems in handling of types and symbols.Martin Odersky2013-12-1415-33/+125
| | | | | | | | | 1. We forgot to mark declaration symbols Deferred. 2. Types with NoPrefix and the same name got identified. Fixed by adding a new category WithNoPrefix to named types, and changing the way named types get generated. 3. Self types lacked parameters. (Question: Do we need to also track type members?) 4. Printers caused cyclic reference errors. Now some print operations are more careful with forcing. 5. Namedparts accumulator has to be more careful with ThisTypes. Because self types now contain parameters, which might lead back to this, we only add the class name (or the source module, if it's a module class). 6. toBounds in TypeApplications needs to use Co/Contra aliases for expanded name parameters, not just local ones.
* Modification of subtype tests of abstract types.Martin Odersky2013-12-131-11/+32
| | | | | | | | | | We ran into a flase path in a situation like this before: A <: B where Type A: A type alias that refers to a constrainable PolyParam P. Type B: An abstract type with bounds L..H. Previously, we would have instantiated P to L, whereas instantiating to B would be the right choice.
* Skipping TypedSplices in TreeInfo methods.Martin Odersky2013-12-111-19/+28
| | | | Before, TreeInfo would mis-predict whenever trees were inserted with TypedSplice. We should make sure the rest of the compiler also takes TypedSplices into account when matching on trees. It's a systemic risk. Not sure we can avoid it with a better design.
* Fixes to typer.Martin Odersky2013-12-116-18/+66
| | | | | | 1. Got rid if InSuperInit mode bit. 2. Fixes to typing assignments 3. Import qualifiers need to be stable
* Fixes to lifting in eta-expansionMartin Odersky2013-12-111-5/+5
| | | | | 1. Lifted defs should not get expr or singleton types of the lifted value. Need to widen. 2. In op-assignments we need to lift the prefix of the lhs function, not the function itself.
* Fixes and tests for typedIdentMartin Odersky2013-12-105-22/+98
| | | | Fixed a problem where an import and a definition in same scope were erroneously regarded as a conflict (L20 in typedIdents.scala)
* Fixing a problem with swallowed errorsMartin Odersky2013-12-102-3/+15
| | | | | | | The problem was that in FunProto#typedArg we cache typed arguments, to retrieve them later, possibly in a different context (Example: typedArg might be computed during overloading resolution, and then cached copy might be inserted in resolved call. The problem is that any errors, warnings or other diagnostics might be swallowed, if typedArg is computed in a context that is not committed but then re-used in a committed context. The fix is to cache typed arguments only if no diagnostics were issued during their computation.
* Fixes to avoid stale symbols and to avoid methods as pattern constructors.Martin Odersky2013-12-095-33/+74
|
* Fix of error that arose when searching for the companion object of a class ↵Martin Odersky2013-12-091-1/+1
| | | | with symbolic name.
* Added desugaring for & and | types.Martin Odersky2013-12-094-2/+24
|
* Fixes to desugaring and typing of parameterized TypedefsMartin Odersky2013-12-093-3/+7
|
* Fixes to inherited result types in Namer.Martin Odersky2013-12-095-15/+37
|
* Fix to & and |Martin Odersky2013-12-091-4/+8
| | | | | | Previously Any & NoType was NoType, whereas it should be Any Similarly for combinations of Nothing with NoType and also for |
* Last fixes to desugar.Martin Odersky2013-12-082-3/+36
|
* Defensive programming in ApplicationsMartin Odersky2013-12-081-3/+5
| | | | | - now handles the case where names in NamedArgs are wrong - assertion check that default getter is indeed present
* Names of created symbols need to be encoded.Martin Odersky2013-12-081-2/+2
|
* Fix to parsing infix types.Martin Odersky2013-12-081-2/+3
|
* Making encode stick on <init>Martin Odersky2013-12-081-1/+2
| | | | Previous one was a no-op, because <init> is excluded from Name#encode
* Fixes to desugaring of for-expressions with embedded aliases.Martin Odersky2013-12-083-29/+81
|
* Fix that avoids overzealous function lifting.Martin Odersky2013-12-081-1/+1
|
* Fixing toText for for expressions.Martin Odersky2013-12-081-1/+6
| | | | Filters did not show the "if" before.
* Fixing problem in TypeComparing.Martin Odersky2013-12-081-1/+1
| | | | Have to strip TypeVars so as to not enter them as bounds.