| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
| |
null is not a subtype of a singleton type in Dotty. This slipped by the type checker before.
With the tightened rules in the next commits, it will become illegal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ported tailcall phase from scalac with such changes:
- all transformation is done in the phase itself
(previously half of the work was done in backend)
- it is now able to run before uncurry
- it is now a treeTransform
- renamed to tailrec to make it more obvious that
this phase transforms only recursive calls.
For now this is a single phase which speculatively
transforms DefDefs.
Speculation can be potentially removed by
splitting into 2 phases:
one detecting which methods should be transformed
second performing transformation.
But, as transformation requires as same amount of work
as detection, I believe it will be simpler to maintain
it as a single phase.
Conflicts:
tests/pos/typers.scala
|
|
|
|
|
|
|
|
|
| |
A self name may no longer have the same name as a parameterless
class member (or param accessor). The restriction makes sense because
otherwise scoping is confusing. It's needed because otherwise we get
TermRefs that have the same name and prefix but denote different things.
Moved some code which exercises this from pos/typers to neg/typers
|
|
|
|
|
|
|
| |
Implemented splitting operations
As a side effect, this contains a test ruling out structural term member dispatch.
Tests 0586 and 0625 which used structural dispatch got moved to neg.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
test case t0273. Was positive in Scala 2, is now deemed to be negative.
Two two definitions
def a = () => ()
def a[T] = (p:A) => ()
do have matching signatures, so should constitute a double definition.
I previously thought that we can get away if the two definitions have
different result types, but then you immediately have a problem because
the denotations have matching signatures for the pruposes of "&" yet
cannot be merged. Which of the two definitions would override
a definition in a base class is then an arbitrary decision.
|
|
|
|
|
|
|
|
| |
The original test is now in error because the type Meta in the prefix Meta#Event
is not stable and contains an abstract member Slog.
Even after removing Slog, the test in pos was still in error because the bound type parameters
were incorrectly recognized as abstract members. This has been fixed by the changes to Types.
|
|
|
|
|
|
| |
Added more tests which all pass, except for tests in disabled and pending.
t0694 went from pos to neg, because the kind of alias type used in t0695 is no longer supported.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Auto-tupling should satisfy the following spec.
1. An application `f(args)` where `f` is a non-overloaded method which has a single, non-repeated parameter as its
first parameter list and where args consists of two or more arguments is expanded to `f((args))`.
2. A constructor pattern `C(args)` where `C.unapply` is a non-overloaded method which has a single, non-repeated parameter as its first parameter list and where args consists of two or more arguments is expanded to `C((args))`.
Auto-tupling can be disabled by language feature "noAutoTupling".
Conflicts:
test/dotc/tests.scala
|
|
|
|
|
|
|
|
|
|
|
|
| |
Companion class/module computations now also work for local classes and modules. For this to work,
either one of two conditions must be met: (1) some enclosing context refers to a scope that
contains the companions. (2) the context's compilation unit has a typed tree that contains the
companions. (1) is usually true when type-checking, (2) when transforming trees.
Local companions are searched as follows: If (2) holds, we locate the statement sequence containing
the companions by searching down from the root stored in the compilation unit. Otherwise, we search
outwards in the enclosing contexts for a scope containing the
companions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Volatile checking needs to take all intersections into account; previously these
could be discarded through needsChecking.
Plus several refactorings and additions.
1) Module vals now have Final and Stable flags set
2) All logic around isVolatile is now in TypeOps; some of it was moved from Types.
3) Added stability checking to Select and SelectFromType typings.
Todo: We should find a better name for isVolatile. Maybe define the negation instead under the name
"isRealizable"?.
|
|
|
|
|
|
|
|
| |
Two fixes:
1) Avoid the infinite recursion in checkAccessible if the accessibility check fails.
2) Make accessibility succeed for the test, and in general if the target denotation does not have a symbol.
Added original test in pos and a negative test which makes accessibility fail.
|
|
|
|
|
| |
More verbose assertions.
Unnecessary semicolons removed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Template parents always were constructor calls before. This is not correct because in a situation like the one
elaborated in templateParents, the trait D has the class C as supertype, but it does not call its constructor (in fact, if we added a () parameter list to make it into a constructor this would be wrong because C takes parameters.
Now parents can be either types or constructor calls.
The logic in Namer and Typer that deals with parents is cleaned up. In particular, we now construct any synthetic class parent as a full type, before calling normalizeToClassRefs. This obviates the forwardRefs logic that needed to be done in a cleanup of Namers.
Also added two more checks: (1) All parents except the first one must point to traits. (2) A trait may not call a parent class constructor.
|
|
|
|
| |
Improves effectiveness of elidable cache from ~66% to ~85% and reduces # of implicits that need to be checked after discarding to about 20% what it was before.
|
|
|
|
|
|
|
|
|
|
|
|
| |
some nested import.
This also changes the criterion when a root import is disabled.
A root import is now disabled if there is an inner import from the same package or module, and the inner import contains at least one disabling clause X => _. (The latter crierion is new; without it, we would consider something like
import scala.{collections => c}
as a hiding import for Scala, which seems to go too far.)
|
|
|
|
| |
Needs to be done always when hitting a wildcard import, not just when something was found
|
| |
|
| |
|
|
|
|
|
|
| |
1. Got rid if InSuperInit mode bit.
2. Fixes to typing assignments
3. Import qualifiers need to be stable
|
|
|
|
| |
Fixed a problem where an import and a definition in same scope were erroneously regarded as a conflict (L20 in typedIdents.scala)
|
| |
|
| |
|
| |
|
|
|