| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Add "enum" construct
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
- rename utility methods
- generate utility methods also for object cases
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| | |
This commit can hopefully be reverted once #2121 is in.
|
| |
| |
| |
| |
| | |
Previous expansion caused 3 spurious follow-on errors which are now
avoided.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
These are now implemented in scala.runtime.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
In case of difference, dump transcript to file for easier comparisons.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Add CSS media queries to support off-canvas sidebar
* Add sidebar toggle interactivity for small viewports
* Re-add sidebar toggle support for desktop viewport widths
* Widen sidebar in mobile viewport and removed extra padding in content body
* Reduce sidebar width back to 250px on Desktop and Tablet viewports
Tablet (576px <= x < 768px) viewport sidebar is now limited to 250px to follow
Desktop viewports whilst still retaining its off-canvas behaviour like Mobile.
Mobile viewport (x < 576px) still implements 60% sidebar width.
* Refactor media queries to follow mobile-first strategy
Instead of specifying specific styles at a viewport width range, e.g. Tablet
(576px <= x < 768px), the CSS properties are arranged as such that default CSS
properties applies to Mobile, with Tablet and Desktop styles defined within
media queries.
Mobile-first strategy will ensure more consistency as style resolution will go
in one direction, e.g. from Mobile -> Tablet -> Desktop.
* Move `div#entity-container` and `div#doc-page-container` further down
The change above, in addition to qualifying `button#menu-toggle` with
`div#content-wrapper` parent selector will make the existing CSS easier
to refactor removing duplicates, and to swap it into CSS pre-processor
languages such as SASS or Less.
* Merge redundant `div#content-body` styles
Two different `div#content-body` styles was defined, one with only
`position: relative` and another with the complete styles.
In addition, a `div#content-body` Tablet and Desktop padding style was moved
into the relevant media query to make future changes more transparent.
* Change `rgba(...)` properties to insert space and prefix decimals with `0`
Within the CSS file, RGBA property declaration is inconsistent: some with space
after comma and some without, some has leading `0` for decimals and some dont'.
This change make sure that one style is followed (space after comma and always
use the leading `0` in decimals).
* Move hamburger menu to original location and restore hover styling
Hamburger menu now stays in the content body as per original design. However
to prevent overlap with body text, a permanent 30px left padding on the body
container has been added.
* Remove hamburger menu transformation into arrow on expansion
As per PR review comments (https://github.com/lampepfl/dotty/pull/2052)
the old hamburger menu style is restored by removing CSS transforms.
* Change hamburger menu positioning to `absolute`
As per PR review comments (https://github.com/lampepfl/dotty/pull/2052)
the hamburger menu positioning is changed back to absolute, which also
means the left padding on content body is no longer needed and can be
removed.
|
|\ \
| | |
| | | |
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: Do not allow types to refer to leaky aliases
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
`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.
|