| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | |
| | | |
| | | |
| | | | |
This commit can hopefully be reverted once #2121 is in.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
`copy` should always return the type of it's rhs. The discussion of
#1970 concluded that no special treatment for enums is needed.
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The same type needs to be used as a result type for
the copy method, and the function type implemented by
the companion module.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
`enum' only allowed as a prefix of classes, dropped from traits and objects.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
It's completely redundant, docstring is just the comment found
at the `start` offset, which is passed anyway.
|
| | | |
| | | |
| | | |
| | | | |
Modify syntax.md and Tokens/Parser/untpd to support enums.
|
| |/ /
| | |
| | |
| | | |
Insert an empty line before "where" in an explanation.
|
|\ \ \
| | | |
| | | | |
Fix #2024: TypeApply can be a final apply of a recursive method.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
nullary methods with type parameters were handled wrongly,
which led to absence of type application and a cryptic error message.
|
| | | |
| | | |
| | | |
| | | | |
It saves tasty output near the class file output to a *.tasty-file.
|
|\ \ \ \
| | | | |
| | | | | |
Make leak avoidance more robust
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | | |
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` 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.
|
|\ \ \
| |/ /
|/| | |
Fixes `@unchecked` warnings
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
Fix #1959: infix type operators in the REPL
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|\ \ \ \
| | | | |
| | | | | |
Create dummy companions for classes without a real one
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| |_|/ /
|/| | | |
|
|\ \ \ \
| | | | |
| | | | | |
Make case class hashCode take class into account
|
| |\ \ \ \ |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Also, update check file.
|
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Previously, elements of the following classes had the same hash code:
case class A()
case class B()
Now they are distinguished.
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
Remove dead code in pattern matching
|
| | | | | |
|
| |/ / /
| | | |
| | | |
| | | | |
Starting from unreachable case https://github.com/lampepfl/dotty/blob/f75caad00256db52bbd3310f245e51d23c2a76cc/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala#L1408
|
|\ \ \ \
| |_|/ /
|/| | | |
Fix #2151: don't die for wrong number of typeargs applied
|
| | | | |
|
| |/ / |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
#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?
|
| | | |
|