aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tests t26xxMartin Odersky2014-05-3016-0/+286
|
* typedTyped needs to maintain Mode.Martin Odersky2014-05-304-3/+33
| | | | | The first part of a type ascription e: T can be a pattern or an expression. The mode has to be kept depending on what it was on the outside.
* Fix of t2660.Martin Odersky2014-05-301-1/+9
| | | | | Auxiliary constructors need to be wrapped in the type parameters of the primary constructor. Otherwise they will not take part in type inference.
* Fix of t2591.Martin Odersky2014-05-303-2/+7
| | | | | | | Needed to wrap a dummyTreeOfType in a TypedSplice to prevent re-typechecking. (In fact, the "tree without pos" check revealed a deeper problem: DummyTrees of types could be typed again, but without the surrounding TypedSplice, the originally stored type would be forgotten and Null would be returned.
* Added t25xx testsMartin Odersky2014-05-306-0/+70
|
* Fix of t2504Martin Odersky2014-05-3010-100/+54
| | | | | | | | | Another problem where we need to insert an implicit on the result type of complex operation. Two additions: (1) If adapt fails, we now try with a weaker FunProto without result type, thus allowing for an additional implicit cpmversion on the result. (2) An Application in a committable context will not fail if the result type does not match the expected one. The problem will be simply deferred in that case.
* Reporter fixMartin Odersky2014-05-301-6/+7
| | | | | | This fixes a bug introuced by 7754c1ee6c4230e424fd99b820471dbd2c1c8390. The reporter state need to be reset undconditionally in a tryWithFallback.
* Refinements in diagnosticsMartin Odersky2014-05-303-5/+15
| | | | | | 1) glb/lub's are reported to subtyping printer instead of typr 2) Null arguments of function protos are printed with their types (views sometimes are transformed into these).
* Fix of pos/t2454Martin Odersky2014-05-3015-5/+6
| | | | "_" type paraeters need to be given fresh names.
* Merge pull request #132 from DarkDimius/small-fixesDmitry Petrashko2014-05-205-23/+30
|\ | | | | Small fixes
| * Fix too precise type error in LazyVals.Dmitry Petrashko2014-05-092-21/+21
| |
| * withPos for Thickets.Dmitry Petrashko2014-05-091-0/+4
| |
| * Fix phase dependencies calculations broken for non-miniphasesDmitry Petrashko2014-05-091-1/+4
| |
| * Fixing positions not being set in CreateCompanionObjectsDmitry Petrashko2014-05-091-1/+1
| | | | | | | | See discussion in #128
* | Merge pull request #133 from dotty-staging/more-testsDmitry Petrashko2014-05-20196-542/+474
|\ \ | | | | | | More tests
| * | reduce test verbosity to get below 10K lines of test outputSamuel Gruetter2014-05-201-2/+2
| | | | | | | | | | | | becaus this is the limit imposed by Travis
| * | remove test t1591b because it depends on scalac 2 sourceSamuel Gruetter2014-05-201-13/+0
| | |
| * | Make java file compile under 1.6.Martin Odersky2014-05-201-2/+2
| | | | | | | | | | | | I still have 1.6 installed. So the two simple fixes are necessary to make my build pass for now.
| * | Fix of pos/t2429Martin Odersky2014-05-209-36/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a hard nut to crack. The problem exemplified by t2429 is that in a situation like val x: T = foo(...) where `foo` needs implicit parameters the expected result type `T` is propagated into the typechecking of foo(...) and consequently also into the implicit parameter search. This is often necessary, for instance to instantiate type parameters. But it can lead to overconstrained searches if in fact the right expansion is val x: T = viewToT(foo(...)(implicit params)) where `viewToT` is some implicit conversion. The fix handles that case by re-hecking the application foo(...) with an empty result type, if the implicit parameter search fails. But the re-checking is very subtle as is explained in the comment to `TyperState#tryWithFallback`.
| * | Changed .gitignore to ignore /classes instead of /bin.Martin Odersky2014-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | bin as output directory clashes with bin/dotc. Btw I have no idea why I cannot ignore .gitignore. I have .gitignore in my .gitignore_global and have configured git to respect that, but no cigar.
| * | Nothing is not a superclass of Null.Martin Odersky2014-05-204-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | Fix so it isn't. This caused an error in ErrorReporting because we do not propagate bounds into a type like ValOrDefDef[_]. Error in `ErrorReporting` is now fixed but the problem is reflected in test case `boundspropagation`.
| * | Tests pos/23xx to 24xx.Martin Odersky2014-05-2037-37/+0
| | |
| * | Avoid hoisting of local classes out of method bodies.Martin Odersky2014-05-205-7/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Doing so is unsound. We instead approximate local classes by their parents, but only if the expected type is not fully defined. This makes the test t2421_delitedsl1.scala in the commit pass. The oter test, blockEscapesNeg.scala is modified to fail. Previously it failed outright but with the new rules the nested class Bar is approximated to Object. That means that the block containing `Foo.Bar` typechecks, but with type `Object` instead of the unreachable `Bar`.
| * | Better printing of anonymous classes.Martin Odersky2014-05-203-11/+18
| | | | | | | | | | | | | | | Used to be just $anon, now is `Ps { ... }`, where `Ps` are the instantiated parents of the anonymous class.
| * | More systematic treatment of prototypes.Martin Odersky2014-05-2011-61/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a delicate balance about how much of a prototype should be passed down the tree when typechecking. Passing little can cause ambiguity errors (both in overloading and in implicit search). Passing too much can cause spurious errors because implicit conversions "down the road" that apply to some tree continaing the result might not be considered. Symptoms of the problems wree that we could not handle the tests included in this commit before. The new scheme is as follows: we always keep all available information in a prototype, but hide nested prototypes behined a `IgnoredProto` wall. These trees will not be considered for conformity checking. When type checking hits an ambiguity, it tries again with a prototype that's one level deeper (has fewer Ignore links) than the previous one. This continues until there are no more Ignore links to unwrap. We also generalize the scheme for wrapping qualifiers of select nodes from realApply to all instances where we compare against a FunProto. Finally, there are some fixes that avoid assertion violations that were provoked by the new typechecking scheme.
| * | Tests pos 20xx 21xxMartin Odersky2014-05-2026-19/+1
| | |
| * | Fix of SI 2133Martin Odersky2014-05-202-1/+20
| | | | | | | | | | | | We now restrict wildcard imports to members that are accessible at the point of import. This is a fix of an open Scala ticket.
| * | Pos tests t17xx - t19xxMartin Odersky2014-05-2050-8/+37
| | |
| * | Reporter refactoringMartin Odersky2014-05-207-113/+100
| | | | | | | | | | | | Refactored reporters to increase clarity and to pave the way for having Diagnostics subclasses.
| * | More testsMartin Odersky2014-05-1259-283/+32
|/ /
* | Merge pull request #128 from dotty-staging/fix/erasure-2Dmitry Petrashko2014-05-0943-363/+742
|\| | | | | Fix/erasure 2
| * Fix dotty deviation failure in TailRecDmitry Petrashko2014-05-081-1/+1
| |
| * Fix lazy vals test broken by fixing fixing tpd.ClassDef.Dmitry Petrashko2014-05-081-11/+12
| |
| * Fixing tpd.ClassDef.Martin Odersky2014-05-081-5/+24
| | | | | | | | | | The superclass comnstructor of a ClassDef is supposed to be a constructor call. The fix ensures this is the case when creating classes with tpd.ClassDef.
| * Adding descriptive message to no-implicits-after-typer assertion.Martin Odersky2014-05-082-2/+4
| |
| * Adding a check that owner chains are correct for -YcheckMartin Odersky2014-05-082-1/+19
| |
| * Adding dependency tracking to constraint satisfactionMartin Odersky2014-05-085-40/+206
| | | | | | | | | | | | | | | | The previous scheme checked all constraint bounds twice everytime the bounds for a parameter in a constraint were changed. The new scheme, which can be disabled by unsetting `Config.trackContrDeps`, only checks those cbounds that directly or indirectly mention the changed parameter.
| * Added compliing dotc/transform to testsMartin Odersky2014-05-081-1/+2
| | | | | | | | With the previous fixes, we can now compile dotc/transform without errors.
| * Tightening of rules for explicit types for implicit defsMartin Odersky2014-05-084-81/+77
| | | | | | | | | | | | | | | | | | | | | | | | 1) We now demand that all implicit defs have an implicit type, not just class members. If we admitted implicit term members without explicit types, the rules and algorithms for dteremining eligible implicits would be greatly complicated (because there's always the danger that inferring the type by typechecking the rhs causes a cyclic reference). 2) We check for violations of this rule earlier, during type completion, in order to avoid cyclic references happening before we do the check.
| * Handling of higher-kinded types in intersections and unions.Martin Odersky2014-05-081-3/+17
| | | | | | | | | | | | | | | | | | | | | | If we intersect a higher-kinded type C with an instance C[T], we should expect C[T]. Conversely, taking the union of a higher-kinded type C and an instance C[T] should give C. Previously, the higher-kinded place-holder $hkN was merged with &/| with the type T which led to type errors.
| * Making dotc/transform Dotty compliantMartin Odersky2014-05-085-35/+37
| | | | | | | | Fixes to make the files in `transform` compile in Dotty.
| * Fix for type applications.Martin Odersky2014-05-081-14/+28
| | | | | | | | | | | | | | | | | | | | | | Test case in TreeTransformers.scala. We have there type Mutator[T] = (TreeTransform, T, Context) => TreeTransform It turns out that then Mutator[X] for some type X did not typecheck because the typer got confused what were the type parameters of the Function3 type on Mutator's RHS. The fix adds a case to handle RefinedTypes that bind type parameters.
| * Optimization: Avoid substituting when checking satisfiabilityMartin Odersky2014-05-081-36/+59
| | | | | | | | | | Instead of replacing all constrained poly params by their lower bounds before checking satsfiability, we now do this on the fly in the subtype tests.
| * Re-enable t0786.Martin Odersky2014-05-081-0/+0
| | | | | | | | t0786 works again after type inference fixes. Re-enabling.
| * Changes to test framework and testsMartin Odersky2014-05-083-15/+19
| | | | | | | | | | | | | | | | | | defaultOptions is now an implicit parameter, which means it can be overridden on a call-by-call basis. Added -Ycheck:front to verify that typed trees typecheck again with same types. The option is disabled for one of the structural tests.
| * Better wildcard type approximationMartin Odersky2014-05-081-11/+10
| | | | | | | | | | | | | | | | 1) PolyParams are now approximated with a bounded wildcardtype representing the bounds in the current constraint, rather than the bounds in the parameter's declaration. That makes them consistent with the handling of TypeVars. 2) Wildcard types are taken into consideration when result types are constrained.
| * Excluding <:< from eligible candidates for views.Martin Odersky2014-05-082-1/+2
| | | | | | | | This is an opimization to save on unncessessary typed implicits.
| * Tightened satisfiablity checks.Martin Odersky2014-05-082-5/+55
| | | | | | | | | | | | Satisfiability was too loose before. It is noww tightened. We check that the lower bounds of all constrained parameters represent a solution to the constraint. To make the check pass we have to first propagate the constraint by re-verifying all bounds.
| * Fixing tailrec test.Martin Odersky2014-05-081-1/+1
| | | | | | | | | | null is not a subtype of a singleton type in Dotty. This slipped by the type checker before. With the tightened rules in the next commits, it will become illegal.
| * Avoid retyping of LiteralsMartin Odersky2014-05-081-0/+3
| | | | | | | | | | | | | | | | | | | | Literals need to be promoted as is, because constant folding might have changed the type of the literal to the expected type. E.g. in val x: Byte = 2 The literal 2 will have type `Byte(2)` but its underlying constant will still be `Int(2)`. So re-typing would give the wrong type.