aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Add sbt incremental compilation supportGuillaume Martres2016-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To test this with sbt, see https://github.com/lampepfl/dotty/wiki/Using-Dotty-with-sbt The following flags are added: - -Yforce-sbt-phases: Run the phases used by sbt for incremental compilation (ExtractDependencies and ExtractAPI) even if the compiler is ran outside of sbt, for debugging. - -Ydump-sbt-inc: For every compiled foo.scala, output the API representation and dependencies used for sbt incremental compilation in foo.inc, implies -Yforce-sbt-phases. This commit introduces two new phases which do not transform trees: - `ExtractDependencies` which extracts the dependency information of the current compilation unit and sends it to sbt via callbacks - `ExtractAPI` which creates a representation of the API of the current compilation unit and sends it to sbt via callbacks Briefly, when a file changes sbt will recompile it, if its API has changed (determined by what `ExtractAPI` sent) then sbt will determine which reverse-dependencies (determined by what `ExtractDependencies` sent) of the API have to be recompiled depending on what changed. See http://www.scala-sbt.org/0.13/docs/Understanding-Recompilation.html for more information on how sbt incremental compilation works. This phase was originally based on https://github.com/adriaanm/scala/tree/sbt-api-consolidate/src/compiler/scala/tools/sbt which attempts to integrate the sbt phases into scalac (and is itself based on https://github.com/sbt/sbt/tree/0.13/compile/interface/src/main/scala/xsbt), but it has been heavily refactored and adapted to Dotty. The main functional differences are: - ExtractDependencies runs right after Frontend (so that we don't lose dependency informations because of the simplifications done by PostTyper), but ExtractAPI runs right after PostTyper (so that SuperAccessors are part of the API). - `ExtractAPI` only extract types as they are defined and never "as seen from" some some specific prefix, see its documentation for more details. - `ExtractDependenciesTraverser` and `ExtractUsedNames` have been fused into one tree traversal in `ExtractDependenciesCollector`. TODO: Try to run these phases in parallel with the rest of the compiler pipeline since they're independent (except for the sbt callbacks in `GenBCode`) ?
* Merge pull request #1256 from felixmulder/topic/test-bcodeDmitry Petrashko2016-05-274-0/+713
|\ | | | | Add bytecode checking infrastructure
| * Add tests for primitive construction as well as reference and boxed unit arraysFelix Mulder2016-05-183-3/+100
| |
| * Add test for `Array.ofDim`Felix Mulder2016-05-171-0/+24
| |
| * Fix #1258: correct behavior for annotated valuesFelix Mulder2016-05-172-19/+35
| | | | | | | | | | | | | | | | | | Annotated values are encapsulated in a `ConcreteAnnotation`, as such, the statement `tpe isRef defn.IntClass` would yield false despite the annotated reference being an Int. The tpe is now unwrapped if it has an annotation. If the transformation fails despite having the annotation the compiler will warn.
| * Add switch verification testFelix Mulder2016-05-172-2/+62
| |
| * Add bytecode checking infrastructureFelix Mulder2016-05-174-0/+516
| |
* | Add Eq instances of standard types to PredefMartin Odersky2016-05-231-1/+5
| | | | | | | | | | | | | | | | | | To make tests pass, this required a looser specification of `assumedCanEquals`, so that an abstract type T can be compared to arbitrary values, as long as its upper bound can be compared. E.g. T == null T == "abc"
* | Downwards comparisons for implicit search and overloading resolutionMartin Odersky2016-05-231-2/+2
| | | | | | | | | | | | | | | | | | Compare selected contravariant arguments as if they were covariant. Which ones is explained in the doc comment for method `isAsSpecificValueType` in Applications.scala. This has the same motivation than what @paulp proposed around 2012. The solution is a bit different from the one proposed then because it only affects top-level parameters.
* | Fix testMartin Odersky2016-05-191-2/+2
| | | | | | | | | | | | | | | | | | | | The previous additional test messed up partest in that file Types.scala was copied twice into the partest-generated directory and then the pos/core tests would compile both copies. This gave a double definition which manifested itself under -Yno-double-bindings as an assertion error. Ideally, partest generation would guard against this situation. For now I avoid the problem by compiling the whole of core without -Ycheck, not jst Types.scala.
* | Fix dotc bootstrap failureMartin Odersky2016-05-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During an attempted dotty bootstrap it was noted that Types.scala did not compile anymore, because `checkUnique` threw a `TypeError` during erasure. The issue was an overloaded member `name` in TermrefWithSig. In NamedType: def name: Name In TermRef: def name: TermName Before erasure, there's one member `name`, after erasure there are two (because after erasure result type counts). The error arose when trying to recompute a member of a `TermRefWithSig` where the name is `name` and the expected signature is `(Nil, ?)`. Since there are two members that match the name and the signature, `checkUnique` triggered a `TypeError`. Before adding `checkUnique`, the previous `atSignature` call would just have returned an arbitrary choice among the two alternative definitions of `name`. The fix is not to use `checkUnique` but to fall back to `d.current` in the case where several alternatives appear. Interestingly, the failure only triggers when -Ycheck options are *disabled*. I added a new test that compiles Types.scala without checks, so we catch this and possibly similar bugs in the future.
* | Test caseMartin Odersky2016-05-181-1/+2
|/
* Rename old DottyRepl (used for power mode) using ILoop to TypeStealerFelix Mulder2016-04-291-1/+1
|
* Revert Scanners and Tokens to their original formFelix Mulder2016-04-281-1/+1
| | | | | Since we decided to go with the non dotty-scanner approach these are unnecessary to have altered, might just as well revert them.
* Add multiline support using ammonite multilineFilterFelix Mulder2016-04-281-1/+1
|
* Initial implementation featuring two different highlightersFelix Mulder2016-04-281-2/+2
| | | | | | | | | | | One was implemted by hand and the other by using dotty's parser. The one built by hand is shorter, and behaves correctly. The scanner one is unfortunately not ready for testing - there are too many things that are workarounds for it to be a good solution as of now The code added from Ammonite is licensed under MIT, not sure where to put the license - but will add it once I know.
* Merge pull request #1211 from dotty-staging/fix-#1202odersky2016-04-161-15/+7
|\ | | | | Fix Tasty errors
| * Update TASTY tests for dotty/srcVladimirNik2016-04-131-14/+3
| |
| * Rearrange pickle testsMartin Odersky2016-04-091-1/+4
| | | | | | | | | | | | | | 1) Move passing test to pickling 2) Add test case for #1212 in pending 3) Disable annotations/internal in pickling tests. They lead to a stable symbol error which is explainable (modifiers are read before symbol is created).
* | Fix issues with `enterBlock` for comment parsingFelix Mulder2016-04-111-0/+30
| |
* | Add commandline argument `-Ykeep-comments` to remove hardcodingFelix Mulder2016-04-071-0/+2
| |
* | Add binding between Symbol and Untyped tree in base contextFelix Mulder2016-04-072-37/+72
| | | | | | | | This commit also adds a printer for use by dottydoc.
* | Change tests to be based on JUnit, rename comments variableFelix Mulder2016-04-072-506/+454
| |
* | Add docstring support for types, vals, vars and defsFelix Mulder2016-04-071-4/+137
| |
* | Fix association of docstrings based on posisitionFelix Mulder2016-04-071-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes errors that would've occurred in this situation: ``` /** Docstring 1 */ <- this one would've been chosen /** Docstring 2 */ /** Docstring 3 */ class Class ``` And this situation: ``` /** Docstring 1 */ trait Trait /** Docstring 2 */ <- this one would've been chosen ```
* | Add package object supportFelix Mulder2016-04-071-2/+93
| |
* | Add ability to parse nested classes/traits docstringsFelix Mulder2016-04-071-1/+47
| |
* | Fix traits w/o bodies not getting the correct docstringFelix Mulder2016-04-071-4/+32
| |
* | Add tests for classes and traitsFelix Mulder2016-04-072-2/+160
|/
* Drop Mode.scala from tasty_typer testMartin Odersky2016-04-011-1/+1
| | | | File was moved, it's no longer in package typer.
* Move Mode to coreMartin Odersky2016-04-012-2/+2
| | | | | 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 build.Dmitry Petrashko2016-03-311-2/+2
|
* Merge pull request #1182 from dotty-staging/repl-fixesodersky2016-03-313-1/+65
|\ | | | | Repl fixes and tests
| * Add docs to TestREPLMartin Odersky2016-03-181-0/+8
| |
| * Move all overridable bits into Config classMartin Odersky2016-03-181-15/+14
| | | | | | | | | | | | Central config class replaces mixture of parameters and fields. The fields were in part in the wrong class, where they could not easily be overridden.
| * Add REPL testsMartin Odersky2016-03-183-1/+58
| |
* | TASTY tests for src/dottyVladimirNik2016-03-241-10/+78
|/
* Merge pull request #1166 from dotty-staging/fix-#1136odersky2016-03-181-2/+2
|\ | | | | Fix typing of SeqLiterals
| * Add second field to SeqLiteralMartin Odersky2016-03-101-2/+2
| | | | | | | | | | | | | | 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.
* | Polish rewrite testMartin Odersky2016-03-121-3/+3
| | | | | | | | Remove println; add docs
* | Rewrite testMartin Odersky2016-03-122-1/+19
|/ | | | Test rewritings that were implemented so far.
* Merge pull request #1126 from sjrd/scalajsDmitry Petrashko2016-03-041-1/+1
|\ | | | | Initial infrastructure and hello world for the Scala.js back-end.
| * Store the JSDefinitions in a custom platform SJSPlatform.Sébastien Doeraene2016-03-011-1/+1
| | | | | | | | | | | | This required the ability to instantiate a different `Platform` depending on settings, which, in turn, required to defer the initialization of `ContextBase.platform`.
* | Neg tests: change val computeFilePathsAndExpErrors to defVladimirNik2016-03-031-3/+3
| |
* | Neg tests: remove negTest flag; neg tests are binded to neg directoryVladimirNik2016-03-032-53/+46
| |
* | Neg tests: remove xerror parameter from tests (compute based on // error)VladimirNik2016-03-032-121/+81
| |
* | Merge pull request #1111 from dotty-staging/fix-#1099Dmitry Petrashko2016-03-021-1/+0
|\ \ | |/ |/| Special case pattern matching against abstract types with class tags
| * Remove bogus testMartin Odersky2016-02-201-1/+0
| | | | | | | | | | Tests failures were caused by previous incomplete implementation of classTag.
* | Add a `dotty-interfaces` packageGuillaume Martres2016-02-282-0/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We introduce a new entry point for the compiler in `dotty.tools.dotc.Driver`: ``` def process(args: Array[String], simple: interfaces.SimpleReporter, callback: interfaces.CompilerCallback): interfaces.ReporterResult ``` Except for `args` which is just an array, the argument types and return type of this method are Java interfaces defined in a new package called `dotty-interfaces` which has a stable ABI. This means that you can programmatically run a compiler with a custom reporter and callbacks without having to recompile it against every version of dotty: you only need to have `dotty-interfaces` present at compile-time and call the `process` method using Java reflection. See `test/test/InterfaceEntryPointTest.scala` for a concrete example. This design is based on discussions with the IntelliJ IDEA Scala plugin team. Thanks to Nikolay Tropin for the discussions and his PR proposal (see #1011).
* | Merge pull request #1112 from dotty-staging/value-classes-private-this-paramDmitry Petrashko2016-02-201-1/+1
|\ \ | |/ |/| Value classes: add support for private[this] parameter