aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fleshed out Splitter phaseMartin Odersky2014-04-083-0/+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/+2
|/ | | | | | | 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/+0
| | | | stripImplicits needs to take polytypes into account.
* Reverting decision what constitutes a double def.Martin Odersky2014-03-212-7/+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/+0
| | | | | 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-2132-0/+0
| | | | 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-1/+1
| | | | | | | | | | | | | | | | | (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/+0
| | | | | | 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-212-3/+37
| | | | | | | | 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-2147-20/+25
|
* Fix of t1123 - Unit discardingMartin Odersky2014-03-211-1/+1
| | | | Need to do unit discarding also in selection prototypes.
* Fix of t112606A - path dependent typesMartin Odersky2014-03-211-0/+0
| | | | Needed an extra case in isSubType.
* Fix of t1056 - PartialFunctionMartin Odersky2014-03-211-0/+0
| | | | type T was not recorgnized as a SAM type because a case was missing in zeroParamClass.
* Fix of t0625 - compare method typesMartin Odersky2014-03-211-0/+0
| | | | | | 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-2111-26/+7
| | | | which all pass.
* Fix of t0774: empty fileMartin Odersky2014-03-214-0/+11
| | | | | | | | | 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-3/+3
| | | | | | | 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-2114-5/+46
| | | | | | 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-1/+1
| | | | A debug assertion in implicitSearch gave a false alarm and was removed.
* Fix of t0504: _root_ not foundMartin Odersky2014-03-211-0/+0
| | | | _root_ is now entered into an enclosing context.
* Fix of t0438 - lambdas and eta expansionMartin Odersky2014-03-215-31/+1
| | | | | | | | | | | | | | 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-219-0/+1
| | | | | | | | 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
|
* Hygienic desugaringMartin Odersky2014-03-2025-0/+250
| | | | | | | | | | | | Made desugaring hygienic. Trees that are derived from some other tree are no longer stored as simple untyped Ident trees, but as TypeTrees that know how to derive their types from some other type. Test cases in pos: hygiene.scala, t0054.scala and t0085.scala. The comment in hygiene.scala points to the difficulties we are facing. In particular, we need type trees that can rebind some references of a source type to local occurrences with the same name. t0054.scala is similar to hygiene.scala. t0085.scala is trickier, but also related. Essentially the problem there is that we have a class that inherits its outer class. In this case it is important to resolve an identifier in the right context. The identifier added to the copy method of a case class must be resolved outside the class (just like the same identifier in the constructor of that case class).
* Appromiximate union types by intersections.Martin Odersky2014-03-201-0/+96
| | | | | | | | | | | | | | | | Appromiximate union types by intersections of their common base classes. Controlled by option -Xkeep-unions. If option is set, no approximation is done. Motivations for approximating: There are two. First, union types are departure from Scala 2. From time to time they lead to failure of inference. One example experiences in Dotty was in a foldLeft, where the accumulator type was inferred to be Tree before and was now a union of two tree specific kinds. Tree was the correct type, whereas the union type was too specific. These failures are not common (in the Dotty codebase there were 3, I believe), but they cause considerable difficulty to diagnose. So it seems safer to have a compatibility mode with Scala 2. The second motivation is that union types can become large and unwieldy. A function like TreeCopier has a result type consisting of ~ 40 alternatives, where the alternative type would be just Tree. Once we gain more experience with union types, we might consider flipping the option, and making union types the default. But for now it is safer this way, I believe.
* Added auto-tupling.Martin Odersky2014-03-202-0/+20
| | | | | | | | | | | | | | Auto-tupling should satisfy the following spec. 1. An application `f(args)` where `f` is a non-overloaded method which has a single, non-repeated parameter as its first parameter list and where args consists of two or more arguments is expanded to `f((args))`. 2. A constructor pattern `C(args)` where `C.unapply` is a non-overloaded method which has a single, non-repeated parameter as its first parameter list and where args consists of two or more arguments is expanded to `C((args))`. Auto-tupling can be disabled by language feature "noAutoTupling". Conflicts: test/dotc/tests.scala
* Merge pull request #81 from DarkDimius/integration/lazyodersky2014-03-201-0/+6
|\ | | | | Allow MiniPhase to be DenotTransformer & LazyVals
| * Re-enabled and renamed testsMartin Odersky2014-03-181-0/+0
| | | | | | | | | | CreateCompanionObjectTests were re-enabled. They failed in a previous version but succeed again in the latest commit. Also uncurry.scala got renamed to curried.scala.
| * Refactored denotation transformersMartin Odersky2014-03-181-0/+6
| | | | | | | | | | | | | | | | Many small and large changes. Added samplePhase to demonstrate functionality. To test functioning, run the compiler with args tests/pos/uncurry.scala -Ylog:sample,terminal
* | move all tests in tests/untried/neg which use implicits to ↵Samuel Gruetter2014-03-19113-0/+0
| | | | | | | | tests/untried/neg-with-implicits
* | apply srewrite (no procedure syntax for constructors) to tests/untried/negSamuel Gruetter2014-03-193-6/+6
| |
* | apply srewrite (explicit types for implicits + no procedure syntaxSamuel Gruetter2014-03-1940-65/+65
|/ | | | for constructors) to tests/untried/pos
* Merge pull request #69 from odersky/topic/generalize-companionsodersky2014-03-162-0/+44
|\ | | | | Bullet-proofing companion objects
| * Bullet-proofing companion objectsMartin Odersky2014-03-132-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | Companion class/module computations now also work for local classes and modules. For this to work, either one of two conditions must be met: (1) some enclosing context refers to a scope that contains the companions. (2) the context's compilation unit has a typed tree that contains the companions. (1) is usually true when type-checking, (2) when transforming trees. Local companions are searched as follows: If (2) holds, we locate the statement sequence containing the companions by searching down from the root stored in the compilation unit. Otherwise, we search outwards in the enclosing contexts for a scope containing the companions.
* | Merge pull request #70 from odersky/fix/annotations-in-patternsodersky2014-03-141-3/+9
|\ \ | | | | | | Fixed two problems with annotated types in patterns
| * | Fixed two problems with annotated types in patternsMartin Odersky2014-03-141-3/+9
| |/ | | | | | | | | | | | | | | | | | | Problem 1: The parser did not accept them. It has to accept a "RefinedType" as an ascription, not a "WithType" (as it did before), or even a "SimpleType" (as speced in the SyntaxSummary). Problem 2: Annotations are always typed as expressions. The annotations in question were typed as patterns before. Tests in Patterns.scala and in the Dotty compiler itself.
* | add tests from scala/test/files/{pos,neg}Samuel Gruetter2014-03-123539-0/+49725
| | | | | | | | with explicit Unit return type
* | Added test for implicits which fail in Scala 2.11.Martin Odersky2014-03-121-2/+10
|/ | | | Mentioned in scala-user by Haoyi Li on 12-Mar-2014
* Merge pull request #61 from odersky/fixes-t00xxodersky2014-03-123-0/+16
|\ | | | | Fixes t00xx
| * Fix constructor completion problem detected in t0054Martin Odersky2014-03-121-0/+4
| | | | | | | | | | | | | | | | | | Constructors need to be completed in the context which immediately encloses a class. Otherwise type references in the constructor see the wrong types, as is demonstrated in t0054. The difficulty here is that the inner class B nested in A also extends from A. Then it makes a difference whether the constructor parameter types of B are resolved in the context of B or in the context of A. Added explanation for context handling of constructors.
| * Fix problems related to t0039Martin Odersky2014-03-101-0/+6
| | | | | | | | | | | | | | | | | | | | | | This test case exercised several problems: 1.)2.) Two ways to run into a cyclic references. Fixed by - assuming an early info when completing a typedef, similarly to what is done for a classdef - doing wellformed bounds checking in a later phase. Failure to check whether arguments correspond to F-bounds. - a substitution was missing.
| * Fix for t1002Martin Odersky2014-03-101-0/+6
| | | | | | | | | | Need to compile the self type of a class not in the context of the class members but one context further out. Reason: self type should not be able to see the members.
* | Merge pull request #60 from odersky/fix/#50-volatileodersky2014-03-121-0/+25
|\ \ | |/ |/| Fix/#50 volatile