| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
If an argumnet to an inline method refers to a closure
that is the result of eta-expanding another inline method
inline the argument method.
|
|
|
|
| |
To do this, factor out Key from Attachment into a new type, Property.Key.
|
|
|
|
|
|
|
|
| |
Drop tree node class 'Pair'. It was used only in imports, where
it can easily be replaced by Thicket.
The envisaged use for generic pairs is almost sure better modelled
by a "Pair" class in Dotty's standard library.
|
|
|
|
| |
Arrange its sub-elements so that they appear strictly left to right.
|
|
|
|
|
|
|
|
|
| |
Now it's annotated first, annotation second.
This is in line with AnnotatedType and in line with the principle
that tree arguments should come in the order they are written. The
reason why the order was swapped before is historical - Scala2 did it
that way.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In particular:
- get rid of envelope, it's too complicated and hides too many errors
- check that everywhere in parsed trees the position range of a parent
node contains the position ranges of its children.
- check that all non-empty trees coming from parser have positions.
The commit contains lots of fixes to make these checks pass.
In particular, it changes the scheme how definitions are positioned.
Previously the position of a definition was the token range of the
name defined by it. That does obviously not work with the parent/children
invariant. Now, the position is the whole definition range, with the
point at the defined name (care is taken to not count backticks).
Namer is changed to still use the token range of defined name as the
position of the symbol.
|
|\
| |
| | |
Clean up config.Printers imports
|
| |
| |
| |
| | |
And remove the not used Printer#echo
|
|/
|
|
|
|
| |
`apply` nodes should not be inserted in the result parts
of a block, if-then-else, match, or try. Instead they should
be added to the surrounding statement.
|
| |
|
|
|
|
|
|
|
| |
Fallback to .filter if a .withFilter is not available, but do this
only for .withFilter calls generated from for expressions (this is
different from what scalac does; the latter can also rewrite
.withFilter calls given in source, which is not desirable.
|
| |
|
| |
|
|
|
|
|
|
|
| |
For the moment under newHK flag.
- avoid crasher in derivedTypeParams (NamedTypes don't always have symbols)
- Revise logic in type comparer for new HK scheme
|
| |
|
|
|
|
|
|
|
| |
As noticed by @smarter we need to ensure that classes owning
derived type params are completed, so that trees get the
proper symbol attachments. This triggered when I changed annotation
transformers - I have no idea whether how two could be related, though.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This means companions will be pickled and we can drop
the special treatement in transformInfo of FirstTransform.
That method is problematic, since it enters new symbols into
a class scope. This is not allowed, since transformInfo needs
to be purely functional, side effects are not permitted
(`enteredAfter` does not work either).
The problem manifested itself when compiling colltest5 with
a requirement failure in the code of `entered` when called
from FirstTransform (trying to enter in a frozen class).
TODO: Once we use statics for LazyVals we can get rid
of the "add companion object" logic in FirstTransform
alltogether.
|
|
|
|
|
|
| |
Setters are normally synthesised in Desugar while expanding the ValDef.
If the tree is a PatDef it is being desugared into several ValDefs that
may need to be desugared once again.
|
|
|
|
|
| |
Mode is used from a lot of low-level code, does not just reflect Typer info.
So it makes more sense top to place it in the core package.
|
|\
| |
| | |
Fix typing of SeqLiterals
|
| |
| |
| |
| |
| |
| |
| | |
The field keeps track of the element type. This is necessary
because JavaSeqLiteral is nonvariant and the elements might
be empty, so we cannot always compute the type from the
element types.
|
| | |
|
| | |
|
|/
|
|
| |
Selectors should be defs, not lazy vals.
|
|\
| |
| | |
Special case pattern matching against abstract types with class tags
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Context bounds did not make it before into secondary
constructors. Now the evidence parameters generated
by context bounds get copied into secondary constructors.
Without this fix, scala.collection.immutable.PagedSeq fails
to compile in new classtag scheme.
|
| | |
|
|/
|
|
|
|
| |
Default getters should have same accessibility as the method they belong to.
Previously, it was the accessibility of the parameter, which makes no sense.
Fixes #1116.
|
|\
| |
| | |
Fix #997
|
| |
| |
| |
| | |
Previously, some definitions were too public, others too private.
|
|/ |
|
|
|
|
| |
As retronym noted on #897, `val` forces to early.
|
|
|
|
| |
Implements SIP #897.
|
| |
|
|
|
|
| |
Symbols can appear in patterns, so inserting an `apply` is wrong.
|
|
|
|
|
|
|
|
| |
Generalize overriding checking from isDefined
to all methods added by desugar to a case class.
None of these methods has an override so we
need to add one in case they do override another method
(previously we would flag this as an error).
|
|
|
|
| |
The less typing we do during Namer, the better.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously all lower case names were treated as variables
in patterns. But that made code like
x: cls
crash the compiler if `cls` was a class. Also, it owuld preventing
this idiom unless one wrote
x: `cls`
We now do it like scalac and treat lower case names as variables
only in arguments of types.
|
|
|
|
|
|
|
|
| |
Taking a reference means that the symbol will be brought forward into the current run,
then if the same symbol is entered from source, a datarace ensues.
This affected the ProductN symbols because these are automatically added to a case class
suring desugaring.
|
| |
|
|
|
|
|
| |
Since we now have two forms of (almost) everything in Definitions,
might as well profit from it.
|
|
|
|
|
|
| |
TypeRef becomes Type, thus removing duplicates. Where
...Type was used in an extraction (e.g. ArrayType(...),
FunctionType(...)), we now use ...Of.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Symbols are not stable between runs, so if some symbol referred
to from Definitions gets recompiled, there are then two Symbols
that are both visible, one referenced from Definitions, the other
the one that got compiled.
Thos led to a crash when e.g. compiling scala.Short, because the
newly compiled symbol was not recognized as a primitive value
class.
The present commit tries to make systematic changes without regard
to simplicity or aesthetics. This will be polished in future commits.
// ### comments signal areas that need further attention.
|
|\
| |
| | |
Fix #877
|
| |
| |
| |
| | |
Use freshName to name evidence parameters.
|
| |
| |
| |
| |
| | |
This will cause them to automatically implement a certain number
of synthetic methods.
|
| |
| |
| |
| | |
Nullary functions are handled by scalac, and dotty should do the same.
|
| |
| |
| |
| | |
Always expand to at least one parameter.
|
|/
|
|
| |
This is sepcified in Sec. 8.5 of the SLS. Fixes #873. Review by @smarter.
|
|
|
|
| |
Supporess creation of implicit factory if it would be illegal.
|