aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer/RefChecks.scala
Commit message (Collapse)AuthorAgeFilesLines
* Cleanups of NameOpsMartin Odersky2017-04-111-8/+7
| | | | Remove unused functionality
* Get rid of SuperAccessor flagMartin Odersky2017-04-111-1/+1
|
* Fix #2077: Optimization of constant conditionalsMartin Odersky2017-03-131-11/+1
| | | | | Move fixed logic to FirstTransform, where the other constant folding operations are also done.
* Fix overriding a Java method with varargsGuillaume Martres2017-03-121-0/+3
| | | | | | | | | | | | | | | | | | If A method like: override def foo(x: Object*) overrides a Java method, it needs to be rewritten as: def foo(x: Seq[Object]) override def foo(x: Array[Object]): Object = foo(Predef.wrapRefArray(x)) This should be handled by ElimRepeated but there were two bugs: - `addVarArgsBridge` was called at phase `thisTransformer.next`, this is too late to create the bridge since `T*` has already been rewritten as `Seq[T]` - The original method symbol needs to have the `override` flag dropped, since it doesn't override anything. Furthermore, RefChecks had to be moved after ElimRepeated, otherwise the testcase would fail the overriding checks.
* Drop named type parameters in classesMartin Odersky2017-03-041-5/+0
| | | | | | | | | | | | | Drop the [type T] syntax, and what's associated to make it work. Motivation: It's an alternative way of doing things for which there seems to be little need. The implementation was provisional and bitrotted during the various iterations to introduce higher-kinded types. So in the end the complxity-cost for language and compiler was not worth the added benefit that [type T] parameters provide. Noe that we still accept _named arguments_ [A = T] in expressions; these are useful for specifying some parameters and letting others be inferred.
* Fix off-by-one error in forward reference checkingMartin Odersky2017-02-181-1/+1
|
* Ennru forward reference error (#1973)Enno2017-02-141-2/+2
| | | | | | | | | | * Change 'forward reference extending over the definition' to Message * Change 'forward reference extending over the definition' to Message * pesky file should not be included * Change 'forward reference extending over the definition' to Message (test case)
* Change 'overrides nothing' to report via Message (see #1965) (#1968)Enno2017-02-121-6/+6
| | | | | | * Change 'overrides nothing' to report via Message, split into two different messages * Change 'overrides nothing' to report via Message, split into two different messages
* Fix #1750: Handle illegal class overrides betterMartin Odersky2017-01-291-0/+2
| | | | | | | | | | | | | | | | | | 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.
* Add two refcheck migration warningsMartin Odersky2016-12-201-2/+3
| | | | | 1. Overriding a Java-8 concrete method now produces a migration warning under -language:Scala2, 2. Overriding a normal with a lazy val is now a migration warning instead of an error.
* Don't require override for Java interface default methodsMartin Odersky2016-12-201-1/+3
| | | | | | Under language:Scala2, don't require an explicit `override' when overriding default methods of Java traits. `scalac` does currently the same thing.
* don't recheck in -Ycheckliu fengyun2016-11-241-37/+0
|
* fix #1642: disallow value classe wrapping value classliu fengyun2016-11-241-2/+5
|
* fix #1670: move the check of value class to typerliu fengyun2016-11-241-2/+1
|
* Move compiler and compiler tests to compiler dirFelix Mulder2016-11-221-0/+1526