| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
Test t0288 moved to disabled due to lack of Java interop.
Test t0273 fixed by relaxing double def condition: We only regard two
definitions that define the same name and have exactly the same signature
as double definitions. Previously, signatures that defined the same parameters
were also excluded.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Appromiximate union types by intersections of their common base classes. Controlled by option -Xkeep-unions.
If option is set, no approximation is done.
Motivations for approximating: There are two. First, union types are departure from Scala 2. From time to
time they lead to failure of inference. One example experiences in Dotty was in a foldLeft, where the accumulator
type was inferred to be Tree before and was now a union of two tree specific kinds. Tree was the correct type, whereas
the union type was too specific. These failures are not common (in the Dotty codebase there were 3, I believe), but
they cause considerable difficulty to diagnose. So it seems safer to have a compatibility mode with Scala 2.
The second motivation is that union types can become large and unwieldy. A function like TreeCopier has a result
type consisting of ~ 40 alternatives, where the alternative type would be just Tree.
Once we gain more experience with union types, we might consider flipping the option, and making union types the
default. But for now it is safer this way, I believe.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
All MiniPhases now as are full-fledged phases,
and are given their own periods and can register DenotTransformers.
MiniPhases belonging to same group(list) will be squashed to single phase.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Creates accessors for lazy vals:
1) lazy local vals are rewritten to dotty.runtime.Lazy*** holders
2) for a non-volatile field lazy val create a non-thread-safe accessor and flag:
2.a) if lazy val type indicates that val is not nullable, uses null value as a flag
2.b) else uses boolean flag for sake of performance, method size, and
allowing more jvm optimizations
3) for a volatile field lazy val use double locking scheme, that guaranties no
spurious deadlocks, using long bits as bitmaps and creating companion
objects to store offsets needed for unsafe methods.
Conflicts:
test/dotc/tests.scala
|
|
|
|
|
| |
CreateCompanionObjectTests were re-enabled. They failed in a previous version but succeed again in the latest commit.
Also uncurry.scala got renamed to curried.scala.
|
|
|
|
|
|
|
|
| |
Many small and large changes. Added samplePhase to demonstrate functionality.
To test functioning, run the compiler with args
tests/pos/uncurry.scala -Ylog:sample,terminal
|
|
|
|
|
|
|
| |
This makes naming uniform between trees and types, and also avoids the clash with
transform.TreeTransformer. The idea is that transformers are parts of phases, and
have logic that is phase-specific. In particular, a context is passed around when
transforming a tree. Maps are simpler, they only have a T -> T apply method.
|
|
|
|
|
|
|
|
|
|
|
| |
I'm about to refactor that method in terms of a TreeAccumulator.
Note that I've packaged the test case in `dotty.tools.dotc.ast`
I believe this is the best approach for organizing unit tests:
the import tax is minimized, and use of relative imports is
made less fragile by avoiding creating new packages to test code.
I'll reorganize the other unit tests like this if others agree.
|
|\
| |
| | |
Bullet-proofing companion objects
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
A transformer that provides a convenient way to create
companion objects.
|
|/
|
|
|
|
|
| |
1) reorders companion objects so that they allways follow matching
classes
2) removes imports and named arguments
3) rewrites all trees holding types are to TypeTrees
|
|\
| |
| | |
Fix/#50 volatile
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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"?.
|
|/
|
|
|
|
|
|
|
| |
1) New method compileFiles which allows one to compile the content of a directory one file or directory
after another.
2) max constraint is printed to typr.
Added new test pos_all. Other pos tests can be retired.
|
| |
|
|\
| |
| | |
Tree transformer&TreeTransform
|
| |
| |
| |
| |
| |
| |
| |
| | |
1) using fast tracks in case node type isn't altered by Transformation;
2) using pre-computed hints(nxTransformXXX arrays) to quickly jump to next transformation interested in transforming particular Tree type;
3) using pre-computed hints(nxPrepareXXX arrays) to know which transformations are going to 'prepare' for transforming particular Tree type;
4) recomputing those hints in case some transformation changed implementation class during 'prepare';
5) TreeTransform is now responsible of calling transformFollowing on nodes created by it.
|
|/
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
For some tests context is required, it should be passed to checker phase.
|
| | |
|
|\ \
| |/
|/| |
Fix/#34 pathresolvers
|
| |
| |
| |
| | |
Right now this one fails.
|
|\ \
| |/
|/|
| | |
Infrastructure for per-phase tests, with inline source as a string.
|
| | |
|
| |
| |
| |
| | |
We need to use Object as parent then, but this was forgotten.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
blacklisted file.
|
|
|
|
|
| |
And silence some of the error messages we print so the build log
doesn't go above 4MB (Travis' limit)
|
| |
|
|\ |
|
| |
| |
| |
| | |
File name issues
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Compiler tests can now be run with configurable number of compilers and runs in a compiler.
|
| |
| |
| |
| | |
... because there's no way to reload them in a new run.
|
|/
|
|
|
| |
Otherwise we get spurious "compiled twice" errors on every symbol defined in a run after the first one.
Also, fixed a bug so that now run ids are correctly incremented.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.)
|