aboutsummaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Fix rebase breakageMartin Odersky2017-04-041-1/+1
|
* 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-042-6/+47
|
* 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
|
* Improvement to REPL testMartin Odersky2017-04-041-1/+4
| | | | In case of difference, dump transcript to file for easier comparisons.
* 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 #2162 from abeln/infix-opDmitry Petrashko2017-04-041-3/+3
|\ | | | | Fix #1959: infix type operators in the REPL
| * Fix #1959: infix type operators in the REPLAbel Nieto2017-04-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Infix type operators were broken in the REPL. The REPL uses fold methods from the untpd package, but those were skipping the operator subtree when folding over an InfixOp. Fix the issue by taking the operator into account. Tested: 1) Verified that only the REPL code uses the modified fold method. 2) Added repl test.
* | Merge pull request #2149 from dotty-staging/fix/false-companion-2Dmitry Petrashko2017-04-041-5/+16
|\ \ | | | | | | Create dummy companions for classes without a real one
| * | Create dummy companions for classes without a real oneGuillaume Martres2017-03-291-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In #2139 I added code to create dummy companions for companion-less objects, but not for companion-less classes because I thought it wasn't needed. But it turns out that even if the classpath only has `Foo.class` and not `Foo$.class`, a module for `Foo` is entered by `initializeFromClassPath` when it calls `enterClassAndModule`, so we have to add dummy companions to classes. I don't have a test to illustrate this issue, but note that it fixes the incremental compilation bug demonstrated by https://github.com/dotty-staging/dotty/commits/incremental-compilation-bug. Note: I verified that adding a dummy companion to "class Foo" did not cause the backend to emit a Foo$.class, so this should have no visible impact.
* | | fix copy of flags for ModuleDef and refactor codeliu fengyun2017-04-031-19/+19
| | |
* | | Merge pull request #2159 from dotty-staging/fix-hashcodeDmitry Petrashko2017-04-031-2/+3
|\ \ \ | | | | | | | | Make case class hashCode take class into account
| * \ \ Merge branch 'master' into fix-hashcodeFelix Mulder2017-04-0210-86/+125
| |\ \ \
| * | | | Use full name of case classes for hashingMartin Odersky2017-03-311-2/+3
| | | | |
| * | | | Optimize hashCode computationMartin Odersky2017-03-311-2/+2
| | | | | | | | | | | | | | | | | | | | Also, update check file.
| * | | | Make case class hashCode take class into accountMartin Odersky2017-03-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, elements of the following classes had the same hash code: case class A() case class B() Now they are distinguished.
* | | | | Merge pull request #2157 from dotty-staging/patmat-dead-codeFelix Mulder2017-04-021-109/+3
|\ \ \ \ \ | |_|/ / / |/| | | | Remove dead code in pattern matching
| * | | | Remove unreachable `tupleExtractor` methodOlivier Blanvillain2017-03-301-22/+1
| | | | |
| * | | | Remove dead code from pattern matcherOlivier Blanvillain2017-03-301-87/+2
| |/ / / | | | | | | | | | | | | Starting from unreachable case https://github.com/lampepfl/dotty/blob/f75caad00256db52bbd3310f245e51d23c2a76cc/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala#L1408
* | | | Merge pull request #2154 from dotty-staging/topic/fix-#2151Felix Mulder2017-03-317-61/+112
|\ \ \ \ | |_|_|/ |/| | | Fix #2151: don't die for wrong number of typeargs applied
| * | | Fix deadlock in `runAll`Felix Mulder2017-03-313-49/+51
| | | |
| * | | Improve summary report by dumping all to stdout on CIFelix Mulder2017-03-314-8/+40
| | | |
| * | | Make DiffUtil's rendering readable in logsFelix Mulder2017-03-313-3/+20
| | | |
| * | | Fix #2151: don't die for wrong number of typeargs appliedFelix Mulder2017-03-311-1/+1
| |/ /
* | | Avoid NPE in ParallelTesting on junk filesMartin Odersky2017-03-311-3/+2
| | | | | | | | | | | | | | | | | | Emacs often produces temporary files in directories. These used to cause NPEs in the new testing framework. We now fix this by only compiling file names that designate source files.
* | | Fix ClassfileParserMartin Odersky2017-03-312-11/+4
| | | | | | | | | | | | | | | | | | | | | #2158 has uncovered flaws in the classfile parser. Matches that used to always miss led to code that made no sense. The function naming was terrible too, that's why nobody understood what was going on. `findSourceFile` to find the class file, seriously?
* | | Fix a bug(I guess?) hidden by scalac sometimes not emitting outer checksDmitry Petrashko2017-03-301-2/+3
| | |
* | | PatMat, Outerchecks: Check outers for selections from singleton type.Dmitry Petrashko2017-03-301-3/+4
| | | | | | | | | | | | | | | Otherwise checks are done also on type projections. Same pitfall as https://issues.scala-lang.org/browse/SI-7214
* | | PatMat: get rid of unnecessary forwarderDmitry Petrashko2017-03-301-8/+2
| | |
* | | Fix #2165, emit outerChecks on ThisTypeDmitry Petrashko2017-03-301-2/+2
|/ / | | | | | | | | | | ThisType doesn't have a termSymbol. And the check is actually too strong, and not needed.
* | Fix typo in `ParallelTesting.scala`Felix Mulder2017-03-301-1/+1
| |