aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer/Checking.scala
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate LambdaAbstractMartin Odersky2017-04-061-1/+1
| | | | Use fromParams instead.
* Further refactoringsMartin Odersky2017-04-061-4/+4
| | | | | - Use TypeLambda instead of PolyType. - Further harmonize factory operations
* Harmonize paramTypes and paramBoundsMartin Odersky2017-04-061-1/+1
| | | | | | MethodTypes have paramTypes whereas PolyTypes have paramBounds. We now harmonize by alling both paramInfos, and parameterizing types that will become common to both.
* Break out functionality from MethodTypeMartin Odersky2017-04-061-2/+2
| | | | | and generalize MethodParam to ParamRef, and TypeParamInfo to ParamInfo
* Merge pull request #2190 from dotty-staging/fix-robust-avoidanceGuillaume Martres2017-04-041-2/+8
|\ | | | | Make leak avoidance more robust
| * Make leak avoidance more robustMartin Odersky2017-04-041-2/+8
| | | | | | | | | | | | If class files are missing, finding an underlying class reference might give a NoType. This caused an asInstanceOf to fail. We now handle that case gracefully.
* | checkNoPrivateLeaks: Do not allow types to refer to leaky aliasesGuillaume Martres2017-04-041-6/+17
|/ | | | | | | | | | | `checkNoPrivateLeaks` can force a lot of things, this lead to hard-to-reproduce issues in unpickling because we called `checkNoPrivateLeaks` on the type parameters of a class before anything in the class was indexed. We fix this by making sure that `checkNoPrivateLeaks` never transforms type symbols, only term symbols, therefore we can unpickle type parameters without forcing too many things. tests/neg/leak-type.scala illustrates the new restriction that this necessitates.
* Check there are no forward dependencies to method parametersMartin Odersky2017-03-141-1/+19
|
* Fix compilation of ParSetLike by itselfGuillaume Martres2017-03-131-3/+3
| | | | | | | Before this commit, ParSetLike compiled fine as part of compileStdLib but crashed when compiled by itself because we tried to force a LazyRef while forcing the same LazyRef. This commit fixes this by being slightly more lazy where it matters.
* Allow abstract type members in objects.Nicolas Stucki2017-03-011-1/+1
|
* Change 'is abstract; cannot be instantiated' to MessageEnno Runne2017-02-201-1/+2
|
* checkNoPrivateLeaks: Use correct position for errorsGuillaume Martres2017-02-171-5/+4
| | | | | | | Previously we never used the `pos` argument of `checkNoPrivateLeaks` and instead used `sym.pos`, this makes a difference for calls to `avoidPrivateLeaks` coming from `TreeUnpickler` where we should use `tree.pos` instead.
* Narrow Java exception to inheritance ruleMartin Odersky2017-02-081-3/+5
| | | | | Excepted are only Serializable and Comparable. This follows scalac's behavior.
* Refine checkTraitInheritance conditionMartin Odersky2017-02-081-3/+16
| | | | | | | | Need to take account of situations like extends Any with java.io.Serializable which occur in stdlib.
* Fix #1501 - Check trait inheritance conditionMartin Odersky2017-02-081-1/+11
| | | | | We need to check a coherence condition between the superclass of a trait and the superclass of an inheriting class or trait.
* Merge pull request #1925 from dotty-staging/fix/inner-vcodersky2017-02-021-0/+2
|\ | | | | Fix #1644: Disallow inner classes in value classes
| * Fix #1644: Disallow inner classes in value classesGuillaume Martres2017-02-011-0/+2
| |
* | Fix #1750: Handle illegal class overrides betterMartin Odersky2017-01-291-0/+5
|/ | | | | | | | | | | | | | | | | | 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.
* Make errors are not swept under the carpetMartin Odersky2016-12-171-3/+2
| | | | | | | | | Typer#ensureReported's comment outlines an example where errors could go unreported, resulting in error trees after typer without any reported error messages. This commit makes sure that at least one error is reported if a tree node has an error type. Fixes #1802.
* Merge pull request #1682 from dotty-staging/vclassodersky2016-12-151-3/+46
|\ | | | | Fix checks related to value classes
| * don't recheck in -Ycheckliu fengyun2016-11-241-3/+46
| |
* | Fix #1786: support use package object in fun callliu fengyun2016-12-131-1/+1
|/
* checkNoPrivateLeaks: handle defs in local classesGuillaume Martres2016-11-221-1/+1
| | | | | | The access boundary of a def in a local class is the owner of that class, previously it was set to the access boundary of the owner of the class instead.
* checkNoPrivateLeaks: handle references to companion membersGuillaume Martres2016-11-221-2/+16
| | | | | | | | | | | Previously Outer2#Inner#foo failed to compile with: ``` non-private method foo refers to private value x in its type signature ``` This should compile because the boundary of `foo` is `class Outer2` and the boundary of `x` is `object Outer2`. This commit fixes this by also considering the linked boundary in `checkNoPrivateLeaks`.
* Move compiler and compiler tests to compiler dirFelix Mulder2016-11-221-0/+557