| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
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.
|
|
|
|
| |
Desugaring worked incorrectly when both context bounds and default parameters were present.
|
|
|
|
|
|
|
| |
Add @sharable annotation for classes and vals that are presumed
to be safely sharable between threads.
Also: Document CtxLazy.
|
| |
|
|
|
|
|
| |
I scanned the main sources with IntellIJ's spell checker and
corrected what showed up.
|
| |
|
|
|
|
| |
Implements #499
|
| |
|
| |
|
| |
|
|
|
|
| |
Otherwise we'll trigger early creation of companions that could shadow something.
|
| |
|
|
|
|
|
| |
They do not have a generated apply method, so cannot be functions.
Problem was unvovered when changing the definition of LazyAnnotation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Lazy fields are
- the rhs field of a ValDef or DefDef
- the body field of a Template
These can be instantiated with Lazy instances.
The scheme is such that lazy fields are completely
transparent for users of the Trees API.
The only downside is that the parameter used to initialize
a potentially lazy field has a weak type (now it's Any, with
Dotty it would be a union type of the form `T | Lazy[T]`.
Therefore, the parameter cannot be recovered through pattern
matching.
|
|
|
|
| |
need to generate more than one parent class.
|
|
|
|
|
|
|
|
| |
Cyclic reference was caused when compiling pos/i94-nada.scala with
typer = new Printer
and -Yfront set.
|
|
|
|
|
|
|
|
| |
scalac has the same restriction. The reason is that we do not have a means
to specify a sequence-valued default for a vararg parameter.
It would be nice if we could, but this requires a more substantial development
effort.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, a double definition errorfor `T` was produced in a case like this:
type T1 = C { T <: A }
type T2 = T1 { T <: B }
This was caused by the way T1 was treated in the refinement class
that is used to typecheck the type. Desugaring of T2 with `refinedTypeToClass`
would give
trait <refinement> extends T1 { type T <: B }
and `normalizeToClassRefs` would transform this to:
trait <refinement> extends C { type T <: A; type T <: B }
Hence the double definition. The new scheme desugars the rhs of `T2` to:
trait <refinement> extends C { this: T1 => type T <: B }
which avoids the problem.
Also, added tests that #232 (fix/boundsPropagation) indeed considers all refinements
together when comparing refined types.
|
| |
|
|
|
|
| |
Typed MemberDef trees now take the modifiers from their symbol's data.
|
|
|
|
| |
Instead of desugaring in parser desugaring is now done during desugaring.
|
|
|
|
|
| |
Reason: We might need hooks for data representation transformations also for private vars.
Private[this] vars in non-trait classes remain setterless.
|
| |
|
|
|
|
|
|
| |
Like other synthetic methods, productArity will not be generated
if an explicit definition is given. Used to be generated unconditionally
in desugaring.
|
|
|
|
| |
Can handle now vararg arguments in patterns.
|
|
|
|
|
|
|
| |
elements.
It's not really an abbreviation to do it for trees with fewer elements and it leads
to unncessessary syntactic variation.
|
|
|
|
| |
Avoid mentioning arguments that are unchanged.
|
|
|
|
|
|
|
|
| |
1) Add copiers with default arguments, to avoid boilerplate
2) All copiers are now curried wrt first argument (which is
the original tree).
We already make use of the new features in cpy.DefDef, but not yet elsewhere.
|
|
|
|
|
|
|
| |
(1) set position of companion object def
(2) companions of case classes taking multiple parameter lists do not inherit from
a function type (reason: we can't straightforwardly converyt a curried method
with multiple parameter lists to a function value).
|
|
|
|
|
| |
Now that caes classes always inherit from ProductX, we can avoid
the special case. (We need to define _1 anyway to implement Product1).
|
|
|
|
| |
Was missing before.
|
|
|
|
|
|
|
|
| |
Case classes with arity <= 1 now also get a ProductN parent trait.
This is necessary because we inherit productArity and Element methods
in case classes from the ProdictN trait.
Needed to add Product0 for this, which is not defined in Scala2.x.
|
|
|
|
|
|
| |
1) Type parameter accessors inherit their variance from the type parameter
2) Copy method parameter defaults are annotated @uncheckedVariance. This is
necessary because default methods will be checked for variance.
|
|
|
|
|
| |
Auxiliary constructors need to be wrapped in the type parameters of the primary constructor.
Otherwise they will not take part in type inference.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, repeated parameters were typed as `<repeated>[T]`. The
method `underlyingWithRepeated` converts `<repeated>[T]` to `Seq[T]`.
This method was called in typedIdent, but the call was ineffective
because the type of a repeated parameter ident is a TermRef. This led
to a retyping error in Decorators.scala under -Ycheck:front.
We now distinguish between the type of the internal parameter ValDef
and the type of the parameter in the MethodType. The former has the type
`Seq[T] @dotty.annotation.internal.repeated`, the latter has the type
`<repeated>[T]`. The translation with `underlyingWithRepeated` thus
becomes unneccessary.
|
|
|
|
| |
remove all isSensical/SuppressedMessage logic from InfoString
|
|
|
|
|
|
|
|
|
|
|
|
| |
Made desugaring hygienic. Trees that are derived from some other tree are no longer stored as simple
untyped Ident trees, but as TypeTrees that know how to derive their types from some other type.
Test cases in pos: hygiene.scala, t0054.scala and t0085.scala.
The comment in hygiene.scala points to the difficulties we are facing. In particular, we need type
trees that can rebind some references of a source type to local occurrences with the same name. t0054.scala is similar to hygiene.scala. t0085.scala is trickier, but also related. Essentially the problem there is that we have a class
that inherits its outer class. In this case it is important to resolve an identifier in the right context. The identifier added to the copy method of a case class must be resolved outside the class (just like the same
identifier in the constructor of that case class).
|
|
|
|
|
|
| |
To get truly hygienic desugared trees, we need a derived type tree scheme that's more
flexible than just the previous two choices of info-of-symbol and typeref-of-symbol.
The new scheme based on DerivedTypeTrees allows arbitrary methods to derive the type tree's type.
|
|
|
|
|
| |
Adds a new scheme by which a TypeTree() can refer for its type to the symbol of some other type.
Applies the scheme to setter parameters, replacing the previous ad-hoc solution.
|
|
|
|
|
| |
Removed annotations from the dotty codebase that were necessary because the inferred union types
caused inference errors later on.
|
|
|
|
| |
Eliminated all "Dotty deviations" which were due to lack of auto-tupling.
|
|
|
|
| |
We need to use Object as parent then, but this was forgotten.
|