aboutsummaryrefslogtreecommitdiff
path: root/tests/neg
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #180 from smarter/fix/nosymbol-subtypingodersky2014-11-061-4/+5
|\ | | | | Fix subtyping of types without symbols
| * Fix subtyping of types without symbolsGuillaume Martres2014-10-091-1/+5
| |
| * Simplify subtying testGuillaume Martres2014-10-091-4/+1
| |
* | Avoid hoisting local classesMartin Odersky2014-10-261-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | The patch disables hoisting of classes local to a block into the result type of the block. Instead, we widen the result type of the block to one which reflects all refinements made to the parents type of the local class. Test cases in avoid.scala, t1569.scala. The original t1569.scala no longer works. Why is explained in neg/t1569-failedAvoid.scala
* | Fix handling of type params in secondary constructorsMartin Odersky2014-10-111-0/+47
| | | | | | | | | | | | | | | | | | Params are already added by Desugar. No special treatment needed here. Besides primaryConstructor.typeParams is always empty, because term symbols do not have type parameters. The fix turns t2660.scala into an error. I believe the error is correct, hence the test was moved with a comment to neg.
* | Merge pull request #174 from dotty-staging/rebDmitry Petrashko2014-10-117-0/+115
|\ \ | |/ |/| Pattern matcher
| * Fix problem in unapply typing.Martin Odersky2014-09-231-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | GADT bound resetting may only be applied when comparing <pattern type> <: <expected type>, not when comparing the other way around. The fix revealed an error in a test case (t1048) which looks like a real error. Therefore the test got moved to neg. Conflicts: src/dotty/tools/dotc/typer/Applications.scala test/dotc/tests.scala tests/disabled/t1048.scala
| * Disabling patmat tests failing due to typer.Dmitry Petrashko2014-09-231-0/+29
| |
| * Fixes to erasure to make -Ycheck:all work.Martin Odersky2014-08-281-0/+7
| | | | | | | | | | | | | | | | Main change: Introduce JavaArrayType as a new type constructor for Java erased array. Translate all methods of Array class during erasure to primitive operations on arrays. Some other small fixes for more localized problems.
| * Special context for self constructor argsMartin Odersky2014-08-242-0/+15
| | | | | | | | | | Arguments to this(...) calls need a special contet, similar to - but different from - the supercall context.
| * Re-enabled checkbounds testsMartin Odersky2014-08-081-0/+39
| | | | | | | | | | | | | | | | Now that F-bunded types are treated more robustly, we can check bounds for non-emptyness during Typer. This unvealed one wrong test (wonder how that passed scalac?), which got moved to neg.
| * Detect cycles and protected legal ones with LazyRefsMartin Odersky2014-08-081-0/+4
| | | | | | | | | | | | | | | | | | | | Cycles are now detected early, when an info is first completed. Legal, f-bounded cycles are broken by a LazyRef, which will construct its type lazily. This makes checkBounds validation of AppliedTypeTrees work (in FirstTransform). Formerly, this stackoverflowed despite the laziness precautions in findMember. Todo: Do the same for class files coming from Java and Scala 2.x.
* | Fix isSubType(A#X, B#X) not checking if A <: BGuillaume Martres2014-10-051-0/+13
|/
* Enabled variance checkingMartin Odersky2014-08-032-0/+69
| | | | | | | Variance checking is now run as part of type-checking. Fixed tests that exhibited variance errors. Added tests where some classes of variance errors should be detected.
* fix/148Martin Odersky2014-07-201-0/+44
| | | | Fixed typo in Splitter. Closes #148.
* Handling higher-kinded types with lambdasMartin Odersky2014-06-182-2/+3
| | | | | Switch to the new scheme where higher-kinded types (and also some polymorphic type aliases) are represented as instances of Lambda traits.
* Change definition of isLegalPrefix so that it allows projecting on an ↵Martin Odersky2014-06-121-0/+7
| | | | | | | | | | | | | | abstract type. This is needed to make the encoding og higher-kinded types work. E.g. Rep[Int] would be represented as Rep { type Arg$0 = Int } # Apply where Apply is an abstract member of the base class Lambfa$I of Rep.
* Reclassifying testsMartin Odersky2014-05-301-0/+35
|
* Avoid hoisting of local classes out of method bodies.Martin Odersky2014-05-201-2/+3
| | | | | | | | | | 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`.
* Pos tests t17xx - t19xxMartin Odersky2014-05-201-0/+25
|
* 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.
* TailRec phase and tests for it.Dmitry Petrashko2014-04-1112-0/+233
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Flag self names that conflict with parameters or membersMartin Odersky2014-04-081-23/+39
| | | | | | | | | 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-082-0/+17
| | | | | | | 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.
* Reverting decision what constitutes a double def.Martin Odersky2014-03-211-0/+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 for t1292 - legal prefixesMartin Odersky2014-03-211-0/+35
| | | | | | | | 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-211-0/+5
| | | | | | 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.
* Added auto-tupling.Martin Odersky2014-03-201-0/+11
| | | | | | | | | | | | | | 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
* Bullet-proofing companion objectsMartin Odersky2014-03-131-0/+16
| | | | | | | | | | | | 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.
* Fix of #50 - volatileMartin Odersky2014-03-091-0/+25
| | | | | | | | | | | | | | Volatile checking needs to take all intersections into account; previously these could be discarded through needsChecking. Plus several refactorings and additions. 1) Module vals now have Final and Stable flags set 2) All logic around isVolatile is now in TypeOps; some of it was moved from Types. 3) Added stability checking to Select and SelectFromType typings. Todo: We should find a better name for isVolatile. Maybe define the negation instead under the name "isRealizable"?.
* Fix of #39Martin Odersky2014-03-041-0/+19
| | | | | | | | Two fixes: 1) Avoid the infinite recursion in checkAccessible if the accessibility check fails. 2) Make accessibility succeed for the test, and in general if the target denotation does not have a symbol. Added original test in pos and a negative test which makes accessibility fail.
* Typos corrected.Dmitry Petrashko2014-03-031-1/+1
| | | | | More verbose assertions. Unnecessary semicolons removed.
* Check that inferred parent classes are feasible.Martin Odersky2014-03-011-0/+7
|
* Reorganization of template parents.Martin Odersky2014-03-012-0/+20
| | | | | | | | | | | Template parents always were constructor calls before. This is not correct because in a situation like the one elaborated in templateParents, the trait D has the class C as supertype, but it does not call its constructor (in fact, if we added a () parameter list to make it into a constructor this would be wrong because C takes parameters. Now parents can be either types or constructor calls. The logic in Namer and Typer that deals with parents is cleaned up. In particular, we now construct any synthetic class parent as a full type, before calling normalizeToClassRefs. This obviates the forwardRefs logic that needed to be done in a cleanup of Namers. Also added two more checks: (1) All parents except the first one must point to traits. (2) A trait may not call a parent class constructor.
* Improve eligible caching in implicit search.Martin Odersky2014-02-021-0/+11
| | | | Improves effectiveness of elidable cache from ~66% to ~85% and reduces # of implicits that need to be checked after discarding to about 20% what it was before.
* Avoid accessing implicits that come from root imports that are hidden by ↵Martin Odersky2014-02-021-1/+1
| | | | | | | | | | | | some nested import. This also changes the criterion when a root import is disabled. A root import is now disabled if there is an inner import from the same package or module, and the inner import contains at least one disabling clause X => _. (The latter crierion is new; without it, we would consider something like import scala.{collections => c} as a hiding import for Scala, which seems to go too far.)
* Fix checking for disabled root importsMartin Odersky2014-02-021-0/+11
| | | | Needs to be done always when hitting a wildcard import, not just when something was found
* Better handling of cyclic reference errors.Martin Odersky2013-12-161-0/+10
|
* Negative typer tests.Martin Odersky2013-12-161-0/+41
|
* Fixes to typer.Martin Odersky2013-12-111-0/+23
| | | | | | 1. Got rid if InSuperInit mode bit. 2. Fixes to typing assignments 3. Import qualifiers need to be stable
* Fixes and tests for typedIdentMartin Odersky2013-12-101-0/+34
| | | | Fixed a problem where an import and a definition in same scope were erroneously regarded as a conflict (L20 in typedIdents.scala)
* Fixes to type applications and unapply.Martin Odersky2013-12-021-0/+17
|
* New tests.Martin Odersky2013-11-091-0/+17
|
* Flipping the logic to determine type leaksMartin Odersky2013-10-241-0/+5
|
* Added some first test files to compileMartin Odersky2013-08-221-0/+23