aboutsummaryrefslogtreecommitdiff
path: root/tests/neg
Commit message (Collapse)AuthorAgeFilesLines
...
* 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