aboutsummaryrefslogtreecommitdiff
path: root/compiler/src
Commit message (Collapse)AuthorAgeFilesLines
* Add HKTypeLambdaMartin Odersky2017-04-061-5/+40
|
* Eliminate MethodOrPolyMartin Odersky2017-04-064-6/+4
| | | | Replace with LambdaType
* Eliminate ParamTypeMartin Odersky2017-04-065-18/+12
| | | | Replace with ParamRef
* replace derived{Method,Poly}Type with derivedLambdaTypeMartin Odersky2017-04-0617-45/+34
|
* Add StarLambda, HKLambda abstractions ...Martin Odersky2017-04-061-70/+79
| | | | | ... to distinguish between HK(proxy) and *(ground) types. Also, refactor some more methods to keep it DRY.
* Make PolyTypes subtypes of LambdaTypesMartin Odersky2017-04-064-98/+89
| | | | Also, rename LambdaOver{Type,Term}s to {Type,Term}Lambda
* Rename PolyParam --> TypeParamRefMartin Odersky2017-04-0628-173/+166
|
* Refactor ParamRef so that no type params are neededMartin Odersky2017-04-064-51/+31
|
* Remove parameter from lambda typeMartin Odersky2017-04-062-9/+12
|
* Get rid of Name parameter for LambdaType and ParamRefMartin Odersky2017-04-064-24/+32
| | | | Use an abstract type instead.
* ParamType refactoringsMartin Odersky2017-04-064-77/+78
| | | | Trying to bring PolyTypes closer to TypeLambdas
* Harmonize paramTypes and paramBoundsMartin Odersky2017-04-0643-213/+216
| | | | | | 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-0620-134/+176
| | | | | and generalize MethodParam to ParamRef, and TypeParamInfo to ParamInfo
* Drop name checking scheme for type parametersMartin Odersky2017-04-061-9/+3
| | | | | It was a red herring. Symbolic names are expanded anyway to $plus / $minus, so they can't be confused with a variance prefix.
* Don't let illegal parameter names propagate into typesMartin Odersky2017-04-061-4/+4
|
* Add neg test for illegal parameter namesMartin Odersky2017-04-061-1/+1
| | | | and fix typo
* Encode variances in parameter namesMartin Odersky2017-04-0613-41/+76
| | | | | | | | | | This leads to a slight overall simplification, harmonizes pickle format with internal representation, and makes MethodTypes and PolyTypes more similar to each other. I believe the change is useful as it is, but in particular it is a useful step for an eventual unification of MethodTypes and PolyTypes.
* Merge pull request #1958 from dotty-staging/add-enumodersky2017-04-0617-147/+512
|\ | | | | Add "enum" construct
| * Emit enum utility methods only if enum class is not genericMartin Odersky2017-04-061-6/+8
| |
| * Implementation of proposal changesMartin Odersky2017-04-052-45/+76
| | | | | | | | | | - rename utility methods - generate utility methods also for object cases
| * Infer enum type args from type parameter boundsMartin Odersky2017-04-041-11/+45
| | | | | | | | | | | | Infer type arguments for enum paraments from corresponding type parameter bounds. This only works if the type parameter in question is variant and its bound is ground.
| * Avoid assertion failure on neg testMartin Odersky2017-04-041-1/+8
| | | | | | | | This commit can hopefully be reverted once #2121 is in.
| * Support cases with type parameters that extend a non-parameterized baseMartin Odersky2017-04-042-16/+24
| | | | | | | | | | | | | | | | Support cases with type parameters that implicitly extend a non-parameterized base without needing their own extends clause. The proposal has been updated to make clear that this is supported. Also address other reviewers comments.
| * Support comma-separated enum constantsMartin Odersky2017-04-043-26/+46
| |
| * Change enumeration members.Martin Odersky2017-04-042-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Based on the discussion in #1970, enumeration objects now have three public members: - valueOf: Map[Int, E] - withName: Map[String, E] - values: Iterable[E] Also, the variance of case type parameters is now the same as in the corresponding type parameter of the enum class.
| * Change return type of `apply`.Martin Odersky2017-04-041-7/+7
| | | | | | | | | | | | | | | | | | | | | | In an enum case like case C() extends P1 with ... with Pn ... apply now returns `P1 & ... & Pn`, where before it was just P1. Also, add to Option test.
| * Don't change the return type of the `copy` methodMartin Odersky2017-04-041-1/+1
| | | | | | | | | | `copy` should always return the type of it's rhs. The discussion of #1970 concluded that no special treatment for enums is needed.
| * Check that cases with type parameters also have an extends clauseMartin Odersky2017-04-041-1/+5
| |
| * Fix cheeky comment in nested scopeFelix Mulder2017-04-041-6/+17
| |
| * More fine-grained distinctions when flags are defined.Martin Odersky2017-04-043-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Flags like Trait are in fact not always defined when a symbol is created. For symbols loaded from class files, this flag, and some other is defined only once the classfile has been loaded. But this happens in general before the symbol is completed. We model this distinction by separating from the `FromStartFlags` set a new set `AfterLoadFlags` and distinguishing between the two sets in `SymDenotations#is`. Test case is enum-Option.scala. This erroneously complained before that `Enum` was not a trait.
| * Fix typoMartin Odersky2017-04-041-1/+1
| |
| * Be more systematic about result of apply methodMartin Odersky2017-04-041-8/+18
| | | | | | | | | | | | The same type needs to be used as a result type for the copy method, and the function type implemented by the companion module.
| * Make `getDocComment` referentially transparentFelix Mulder2017-04-041-36/+12
| |
| * Fix "closest" computation for docstringsMartin Odersky2017-04-041-1/+3
| |
| * Comment out unused method in ContextMartin Odersky2017-04-041-2/+3
| |
| * Implement enum desugaringMartin Odersky2017-04-044-36/+189
| |
| * Change handling of enum defs.Martin Odersky2017-04-042-15/+34
| | | | | | | | | | | | | | The previous scheme did not work because desugaring cannot deal with repeated expansions. We now sidestep the issue by doing the expansion in the parser. Luckily, positions work out perfectly, so that one can reconstruct the source precisely from the parsed untyped trees.
| * Allow value expansion of modules in mergeCompanionDefsMartin Odersky2017-04-041-1/+0
| |
| * Simplify syntaxMartin Odersky2017-04-045-14/+14
| | | | | | | | `enum' only allowed as a prefix of classes, dropped from traits and objects.
| * Don't pass docstring as a parameter.Martin Odersky2017-04-041-39/+33
| | | | | | | | | | It's completely redundant, docstring is just the comment found at the `start` offset, which is passed anyway.
| * Add enum syntaxMartin Odersky2017-04-043-25/+102
| | | | | | | | Modify syntax.md and Tokens/Parser/untpd to support enums.
| * Fix mal-formatting.Martin Odersky2017-04-042-3/+5
| | | | | | | | Insert an empty line before "where" in an explanation.
* | Merge pull request #2025 from dotty-staging/fix-2024Nicolas Stucki2017-04-053-7/+20
|\ \ | | | | | | Fix #2024: TypeApply can be a final apply of a recursive method.
| * | Change -XemitTasty to -YemitTastyDmitry Petrashko2017-04-041-1/+1
| | |
| * | Fix #2024: TypeApply can be a final apply of a recursive method.Dmitry Petrashko2017-03-081-0/+4
| | | | | | | | | | | | | | | nullary methods with type parameters were handled wrongly, which led to absence of type application and a cryptic error message.
| * | Add support for `-XemitTasty`.Dmitry Petrashko2017-03-082-7/+16
| | | | | | | | | | | | It saves tasty output near the class file output to a *.tasty-file.
* | | 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-042-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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.
* | | Merge pull request #2168 from allanrenucci/warningsGuillaume Martres2017-04-045-11/+10
|\ \ \ | |/ / |/| | Fixes `@unchecked` warnings