aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
Commit message (Collapse)AuthorAgeFilesLines
* Fix of t2591.Martin Odersky2014-05-301-0/+15
| | | | | | | 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-303-0/+33
|
* Fix of t2504Martin Odersky2014-05-302-6/+6
| | | | | | | | | 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.
* Fix of pos/t2454Martin Odersky2014-05-3014-0/+268
| | | | "_" type paraeters need to be given fresh names.
* remove test t1591b because it depends on scalac 2 sourceSamuel Gruetter2014-05-201-13/+0
|
* Fix of pos/t2429Martin Odersky2014-05-201-0/+25
| | | | | | | | | | | | | | | | | 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`.
* Nothing is not a superclass of Null.Martin Odersky2014-05-201-0/+9
| | | | | | | | 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-2010-0/+128
|
* More systematic treatment of prototypes.Martin Odersky2014-05-204-0/+70
| | | | | | | | | | | | | | | | | | | 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-2021-0/+222
|
* Fix of SI 2133Martin Odersky2014-05-201-0/+18
| | | | 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-2027-0/+351
|
* More testsMartin Odersky2014-05-1215-0/+217
|
* Re-enable t0786.Martin Odersky2014-05-081-0/+29
| | | | t0786 works again after type inference fixes. Re-enabling.
* Moved tests to pending because they fail -Ycheck:frontMartin Odersky2014-05-082-58/+0
|
* New phase: NullarifyMartin Odersky2014-04-151-0/+13
| | | | Eliminates ExprTypes and PolyTypes over value types.
* Fixing prefix of implicit membersMartin Odersky2014-04-141-0/+19
| | | | | | | Implicit members are TermRefs that should have a prefix corresponding to the object of which they are a member. They used to have the ThisType of their owner before. `implicits2` provides a way to verify that the change works. It would be good to turn this into a more robust test at some point. But it's not high preiority, so I prefer no test to a fragile test.
* TailRec phase and tests for it.Dmitry Petrashko2014-04-119-1/+125
| | | | | | | | | | | | | | | | | | | | | | | | Ported tailcall phase from scalac with such changes: - all transformation is done in the phase itself (previously half of the work was done in backend) - it is now able to run before uncurry - it is now a treeTransform - renamed to tailrec to make it more obvious that this phase transforms only recursive calls. For now this is a single phase which speculatively transforms DefDefs. Speculation can be potentially removed by splitting into 2 phases: one detecting which methods should be transformed second performing transformation. But, as transformation requires as same amount of work as detection, I believe it will be simpler to maintain it as a single phase. Conflicts: tests/pos/typers.scala
* Shadowed referencesMartin Odersky2014-04-081-0/+7
| | | | | | | | | | | | | | | | | | | In TypeAssigner#ensureAccible we sometimes pick an inherited public member as the denotation of a NamedType instead of an inaccessible private one. The problem is that both are denotations for the same type, which caused a noDoubleBindings assert failure. We now solve this problem by creating a "shadowed" named type to hold the inherited member. The shadowed named type is distinguished by its name, which reads (inherited)originalName In the future, we should make this more robust by using a general tagging scheme to create shadowed names. Another fix is about import symbols. They are now referenced with NonMemberTermRefs. With this fix, the test suite passes with no double def violations.
* CleanupsMartin Odersky2014-04-081-0/+3
| | | | | Conflicts: src/dotty/tools/dotc/transform/Splitter.scala
* Flag self names that conflict with parameters or membersMartin Odersky2014-04-081-41/+43
| | | | | | | | | A self name may no longer have the same name as a parameterless class member (or param accessor). The restriction makes sense because otherwise scoping is confusing. It's needed because otherwise we get TermRefs that have the same name and prefix but denote different things. Moved some code which exercises this from pos/typers to neg/typers
* Fleshed out Splitter phaseMartin Odersky2014-04-083-17/+11
| | | | | | | Implemented splitting operations As a side effect, this contains a test ruling out structural term member dispatch. Tests 0586 and 0625 which used structural dispatch got moved to neg.
* Merge pull request #109 from DarkDimius/erasure-bridgesDmitry Petrashko2014-04-041-0/+11
|\ | | | | Bridge generation in erasure implemented.
| * Bridge generation in erasure implemented.Dmitry Petrashko2014-04-041-0/+11
| | | | | | | | | | | | Relies on meaning of "override" to see which bridges are required. Doesn't take in account value classes for now Uses 'adapt' used by erasure for converting arguments and return value.
* | Merge pull request #112 from dotty-staging/topic/loggable-transformsDmitry Petrashko2014-04-041-0/+13
|\ \ | | | | | | Topic/loggable transforms
| * | test for allOverriddenSymbolsMartin Odersky2014-04-041-0/+13
| |/ | | | | | | ... to verify whether they work correctly.
* / Intercepted methods transformerDmitry Petrashko2014-04-021-0/+8
|/ | | | | | | Replace member references for: methods inside Any( == and !=) ## on primitives .getClass on primitives
* More fixes and tests for easure.Martin Odersky2014-03-311-0/+14
| | | | | | | | | | | | | | | | | | | 1. Object_isInstanceOf/asInstanceOf are no longer parameterized methods (seems there's no point in writing x.$asInstanceOf[T]() instead of the shorter x.$asInstanceOf[T]). 2. Array constructor's type is unchanged (the previous rules erased it to def <init>(len: Int)Object which is clearly wrong). 3. indexing needs to be disabled. 4. typedTypeApply needs to keep type applications that apply to type tests and type casts as well as array ops. 5. References to self-ids are typed ThisType(cls) before erasure; are replaced by This(cls) references during erasure.
* Fixes to erasureMartin Odersky2014-03-291-0/+15
| | | | | | | | | | Various fixes to the tree transformer. In the denotation transformer we now keep self types around because otherwise sourceModule would stop to work. Conflicts: src/dotty/tools/dotc/core/transform/Erasure.scala
* Fix of Fix of t1236: higher-kindedMartin Odersky2014-03-211-8/+11
| | | | | | Fix of d6df293d2120f2247198cb6646a23c338f7dcbbf. It turned out the original commit was faulty in that iterator.flatten did not typecheck. The problem is fixed in this commit and flatten is added to the collections test.
* Fix of t1272: overloading resolutionMartin Odersky2014-03-211-0/+9
| | | | stripImplicits needs to take polytypes into account.
* Reverting decision what constitutes a double def.Martin Odersky2014-03-212-14/+7
| | | | | | | | | | | | | | | test case t0273. Was positive in Scala 2, is now deemed to be negative. Two two definitions def a = () => () def a[T] = (p:A) => () do have matching signatures, so should constitute a double definition. I previously thought that we can get away if the two definitions have different result types, but then you immediately have a problem because the denotations have matching signatures for the pruposes of "&" yet cannot be merged. Which of the two definitions would override a definition in a base class is then an arbitrary decision.
* Fix of t1279a: baseTypeWithArgsMartin Odersky2014-03-211-0/+39
| | | | | baseTypeWithArgs now also keeps track of refinements in the subtypes. Without that, the approximated lub in t1279a is too coarse and the program fails to typecheck.
* More tests, currently disabledMartin Odersky2014-03-214-0/+30
| | | | Mostly Java interop tests which are not yet supported. The test infrastructure for Java ocmpilation and the java parser from Scala are still missing.
* Fix of t1236: higher-kindedMartin Odersky2014-03-211-0/+14
| | | | | | | | | | | | | | | | | (and also of t0625, which reappeared). Several fixes were made. In summary: 1. Naming and representation of KigherKinded traits changed. It's now $HigherKinded$NIP where the letters after the second $ indicate variance (N)egative, (I)nvariant, (P)ositive. The HKtraits themselves are always non-variant in their parameters. 2. When deriving refined types over higher-kinded types, the variance of a type alias is the variance of the new type constructor. 3. isSubTypeHK was changed, as was the position from where it is called. 4. appliedTo also works for PolyTypes.
* Fix of t1280 - type of selfMartin Odersky2014-03-211-0/+1
| | | | | | The type of self name "x" was taken to be the thisType of the current owner. But the current owner was a local dummy of the class in question, so the ThisType was NoPrefix. Inserting an enclosingClass fixes the problem.
* Fix for t1292 - legal prefixesMartin Odersky2014-03-211-0/+32
| | | | | | | | The original test is now in error because the type Meta in the prefix Meta#Event is not stable and contains an abstract member Slog. Even after removing Slog, the test in pos was still in error because the bound type parameters were incorrectly recognized as abstract members. This has been fixed by the changes to Types.
* More testsMartin Odersky2014-03-2138-0/+549
|
* Fix of t1123 - Unit discardingMartin Odersky2014-03-211-0/+11
| | | | Need to do unit discarding also in selection prototypes.
* Fix of t112606A - path dependent typesMartin Odersky2014-03-211-0/+25
| | | | Needed an extra case in isSubType.
* Fix of t0625 - compare method typesMartin Odersky2014-03-211-0/+8
| | | | | | Method type comparison via <:< yielded false if the signatures of the two method types differed. This is too strict, because methods can have the same parametyers but different result types and still be in a subtype relationship. We now onyl demand that the sighatures have the same parameters.
* More testsMartin Odersky2014-03-216-0/+68
| | | | which all pass.
* Fix of t0774: empty fileMartin Odersky2014-03-214-0/+21
| | | | | | | | | Was previously wrapped in a package <empty> but the resulting tree had no position, which caused a Typer assertion. If now represented as EmptyTree.
* Fix of t0786: view boundsMartin Odersky2014-03-211-0/+29
| | | | | | | Previously, only implicit method types were eligible as views. This is too strict, as it rules out view bounds. We now also consider types that derive from Function1. The reason for not allowing any type is that this would cause us to check many more types for applicability when an implicit view is searched.
* More testsMartin Odersky2014-03-219-0/+120
| | | | | | Added more tests which all pass, except for tests in disabled and pending. t0694 went from pos to neg, because the kind of alias type used in t0695 is no longer supported.
* Fix of t0591: implicitlyMartin Odersky2014-03-211-0/+7
| | | | A debug assertion in implicitSearch gave a false alarm and was removed.
* Fix of t0504: _root_ not foundMartin Odersky2014-03-211-0/+9
| | | | _root_ is now entered into an enclosing context.
* Fix of t0438 - lambdas and eta expansionMartin Odersky2014-03-211-0/+12
| | | | | | | | | | | | | | Two fixes were needed 1) When typing a function value (x1: T1, ..., xN: Tn) => e, don't unconditionally issue an error if the expected function type arity is different from N. Instead, issue an error only if one of the types T1, ..., Tn is absent. The idea is that only then we need to consult the expected type for the parameter type. This allows to fix the problem later by an implicit conversion applied to the function value. 2) When eta-expanding, do not automtically take the arity of the expected function value as the arity of the generated lambda. Instead, take the method's arity, and copy method parameters into the lambda in case the arities are different.
* Tests t01xx and t02xxMartin Odersky2014-03-217-0/+89
| | | | | | | | Test t0288 moved to disabled due to lack of Java interop. Test t0273 fixed by relaxing double def condition: We only regard two definitions that define the same name and have exactly the same signature as double definitions. Previously, signatures that defined the same parameters were also excluded.
* Minor improvements to tests (remove old comments)Tobias Schlatter2014-03-207-22/+7
|