aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/overrides.scala
Commit message (Collapse)AuthorAgeFilesLines
* Fix #1750: Handle illegal class overrides betterMartin Odersky2017-01-291-5/+0
| | | | | | | | | | | | | | | | | | Illegal class overrides are fundamentally at odds with the way dotty represents types and therefore can cause lots of low-level problems. Two measures in this commit First, we detect direct illegal class overrides on completion instead of during RefChecks. Break the override by making the previously overriding type private. This fixes i1750.scala, but still fails for indirect overrides between two unrelated outer traits/classes that are inherited by the same class or trait. We fix this by catching the previously thrown ClassCastException in both ExtractAPI and RefChecks. Test case for indirect overrides is in i1750a.scala.
* Enforce rule that laziness is preserved when overriding.Martin Odersky2016-02-091-1/+7
|
* Check types for overriding conditions.Martin Odersky2015-12-141-0/+18
| | | | Closes #241 -- that took a while!
* Better diagnosis for cyclic references caused by class clashes.Martin Odersky2015-12-141-19/+0
| | | | | | | We now get a cyclic reference when inheriting from an inner class with the same name in an outer supertype. Since this was legal in Scala2 it's good to explain that particular case. Test case in overrideClass.scala
* Make some types of definitions symbolicMartin Odersky2015-12-141-11/+11
| | | | | | | | | This is needed to ensure that the type of a definition node (ValDef, TypeDef, or DefDef) always refers to the symbol of that definition. Caused a spurious error in selfReq to go away (so error count was updated).
* More negative override testsMartin Odersky2015-02-071-0/+14
|
* Fix of #329.Martin Odersky2015-02-071-0/+7
| | | | Overriding pairs needs to match ExprTypes with field types. Closes #329.
* Test reorgMartin Odersky2015-02-071-0/+21
|
* Add tests for the overriding of typesGuillaume Martres2014-11-181-0/+11
| | | | These tests work correctly since 222e9a478f7b851582550973df6a9d141766e49a
* Check that overriding members refine the types of overridden ones.Martin Odersky2014-11-181-0/+11
| | | | | Somehow this was lost in porting (or was this done somewhere else in scalac?).
* Fix OverridingPairsMartin Odersky2014-11-141-0/+59
OverridingPairs had several bugs which caused pairs to be lost, which caused missing overrides checks. Fixing OverridingPairs revealed several test failures (and a problem in Synthetics generation which was fixed in the last commit). Tests that became negative are all moved into neg/overrides.scala, and the original versions in pos were fixed.