aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix for denotsNamed.Martin Odersky2013-12-252-3/+3
| | | | Previously, the filterDisjoint forced the signature computation too eagerly, which led to a stub for AnyRef.
* Fix bug in uninstantiatedTypeParamsMartin Odersky2013-12-251-1/+1
|
* Classdefs print their scopes under -verboseMartin Odersky2013-12-251-1/+2
| | | | This is a debugging measure (maybe migrate to a different setting?)
* Dropping redundant treatment of constructors in selectionType.Martin Odersky2013-12-241-3/+1
| | | | Constructors are handled anyway in computeNPMembersNamed
* Fixing problems in treatment of private symbolsMartin Odersky2013-12-247-34/+69
| | | | | | | | | | | | 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.
* Fixed desugaring of SymbolMartin Odersky2013-12-241-1/+3
| | | | Need to do Symbol.apply(...) instead of new Symbol(...) because symbols are hash-consed and the constructor is private. This slipped through because of the wholes in accessibility checks which will be fixed in the next commit.
* Refining checkClassTypeWithStablePrefixMartin Odersky2013-12-243-22/+22
| | | | Needs to unwrap parameters. While we are at it, breaking out common functionality in underlyingClassRef.
* Fixing desugarings of classes.Martin Odersky2013-12-231-5/+11
| | | | | | | | | | | | | | | | | | | | | | 1) get Method The idea is that if a case class has exactly one case field, then that field is returned as result of the get method. If it has more than one, it is a subtype of Product and the fields are returned by the _i methods. 2) unapply: Boolean If a class has no case fields the unapply method returns true, rather than the this. 3) Self names A self clause { self => ... if now desugared to { self: C => where C is the type of the class.
* Making default getters for constructor of a case class work also for its ↵Martin Odersky2013-12-233-6/+13
| | | | apply method.
* Early indexing of parameters in classes.Martin Odersky2013-12-231-10/+15
| | | | Type parameters of classes have to be entered before the class is completed.
* Refactored NamerMartin Odersky2013-12-231-65/+59
| | | | Namer refactorings that break out the functionality for class completing into a separate class. We need to enter type parameters early in a second step.
* Typing by-name parameters with ExprTypes.Martin Odersky2013-12-2215-30/+40
| | | | To avoid duplication between by-name parameters and expr types, we treat by-name parameters as as having ExprType. A part of this is introducing ByNameTypeTree, a specific tree class for => T types.
* Making showDcls return a string.Martin Odersky2013-12-221-1/+1
| | | | ... as all other show methods do.
* Fix in parsing annotations.Martin Odersky2013-12-221-1/+1
| | | | Annotaton and argument appeared in reversed order.
* Fix in treatment of type parameters for default getters of primary constructorsMartin Odersky2013-12-221-4/+5
| | | | These need to have their paramAccessor and other flags removed, leaving only Param.
* Not counting type arguments for numArgsMartin Odersky2013-12-221-2/+1
|
* Generalized ensure constructor logic from Java classes to all classes or ↵Martin Odersky2013-12-222-7/+4
| | | | | | traits except Java modules. We now assume that all classes or traits (with the exception of Java statics) have a constructor.
* Normalize parents to be class refsMartin Odersky2013-12-224-8/+9
| | | | | | Previously, alias type refs were also accepted. But this is the wrong assumption for computeMembersNames. So, e.g. instead of leaving an AnyRef we now expand to Object. Also making ==, != take an Any instead of Object
* Make PolyProto a true prototype.Martin Odersky2013-12-221-1/+9
| | | | Otherwise type comparers will go wrong.
* Desugaring changesMartin Odersky2013-12-223-23/+31
| | | | | | | 1) Desugar type bounds containing empty trees 2) Include a productN parent for a case class, only if the case class has 2 or more parameters in its parameter section. Also, handle type bounds appearing in AppliedTypeTrees (these represent wildcard types).
* Starting to test compiling the compiler.Martin Odersky2013-12-212-1/+22
|
* Adding () insertion to normalization.Martin Odersky2013-12-212-6/+18
| | | | | | | | | | | | We need to take account of the possibility of inserting a () argument list in normalization. Otherwise, a type with a def toString(): String member would not count as a valid solution for ?{toString: String}. This would then lead to an implicit insertion, with a nice explosion of inference search because of course every implicit result has some sort of toString method. The problem is solved by dereferencing nullary method types if the corresponding function type is not compatible with the prototype.
* Adding a subtype relationship between ()T and =>TMartin Odersky2013-12-211-3/+12
|
* Rename TyperPhase.scala -> FrontEnd.scalaMartin Odersky2013-12-211-1/+1
|
* Handling implicit unapply arguments.Martin Odersky2013-12-209-24/+58
| | | | Changed format of UnApply nodes to also take implicit parameters. See doc comment in class Trees.UnApply
* Changing TypeMap to drop annotationsMartin Odersky2013-12-201-1/+2
| | | | | | | | | | This is quite drastic. The problem is, we do not really know what to do with annotations in types. In a case demonstrated by dotc.ast.CheckTrees, a substitution of type parameter T in class Trees[-T @uncheckedVariance] gave us Trees[Type @uncheckedVariance], which messed up type inference in implicit search afterwards. In the case above, we clearly want to lose the annotation if the underlying type is not a type variable. Even if the underlying type is a type variable, the annotation looks wrong, since it should apply only to T, not that other variable. So the safest route seems to be to just drop the annotation. That was a specific case, how to draft a general rule? In the absense of a better idea, it seems safest to always drop type annotations if the underlying type changes in a transformation. If some map does not want that behavior it would have to implement the AnnotatedType case explicitly.
* More shadowing tweaking.Martin Odersky2013-12-191-4/+10
|
* Refinement to shadowing checking for implicitsMartin Odersky2013-12-193-3/+12
| | | | Shadowing got confused if the shadowing expression truned out to be a closure.
* Fixed problem in adapt after infer implicit arguments.Martin Odersky2013-12-191-1/+1
|
* 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
|