aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core
Commit message (Collapse)AuthorAgeFilesLines
* Fix #657: Add scala.Dynamic support.Nicolas Stucki2016-07-071-0/+3
|
* SymDenotations: fix comment.Dmitry Petrashko2016-06-071-1/+1
|
* Fix Ycheck: allow assigning fields in static constructors.Dmitry Petrashko2016-06-072-0/+5
|
* Fix type in SymDenotations.Dmitry Petrashko2016-06-071-1/+1
|
* Allow creating static initialisers.Dmitry Petrashko2016-06-071-0/+1
|
* SymDenotations: Allow entering Static symbols.Dmitry Petrashko2016-06-071-1/+1
| | | | They aren't inherited and can be entered into frozen owners.
* Merge pull request #1288 from dotty-staging/fix/implicit-caching-2Guillaume Martres2016-06-031-2/+7
|\ | | | | Implicit scope caching: bug fixes and performance improvements
| * Avoid creating AndTypes with AnyGuillaume Martres2016-05-311-1/+6
| | | | | | | | This reduces the number of implicit scopes we cache.
| * Never include self types in named parts of a typeGuillaume Martres2016-05-311-1/+1
| | | | | | | | | | | | | | | | | | According to SLS ยง 7.2, self types are not a named part of a type, so they're not part of the implicit scope. Before this commit, this was usually the case because we normally refer to a class using a TypeRef, but in some cases a class might appear as a ThisType, and ThisType#underlying returns the self type, we now use ThisType#tref instead which just returns a TypeRef corresponding to the class.
* | Merge pull request #1251 from felixmulder/topic/fix-stdoutredirect-replFelix Mulder2016-06-011-0/+4
|\ \ | |/ |/| Fix stdout redirect for REPL's println
| * Disable "auto" alternative in `-color` flagFelix Mulder2016-06-011-1/+1
| |
| * Factor out coloring check to new method `Context#useColors`Felix Mulder2016-05-201-0/+4
| |
* | Add sbt incremental compilation supportGuillaume Martres2016-05-282-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`) ?
* | Add Types#TypeTraverser for convenienceGuillaume Martres2016-05-281-0/+6
| | | | | | | | This works similarly to `Trees#TreeTraverser`.
* | Fix memberExcluding for ClassInfoGuillaume Martres2016-05-281-2/+10
| |
* | Avoid issues when calling methods on root package symbolGuillaume Martres2016-05-282-2/+2
| | | | | | | | | | SymDenotations#topLevelClass: don't throw an exception Symbols#associateFile: avoid infinite loop
* | Merge pull request #1270 from dotty-staging/fix-bootstrapDmitry Petrashko2016-05-279-84/+253
|\ \ | | | | | | Fix bootstrap
| * | Fix typos in commentsMartin Odersky2016-05-231-2/+2
| | |
| * | Make isCOmpanion test cheaperMartin Odersky2016-05-231-6/+27
| | | | | | | | | | | | | | | | | | | | | As explained in the comment, a scalacLinkedClass must also be a true companion unless the original symbol is a root. This avoids us to drop the (potentially large) unpickled map and save some memory.
| * | Remember owner in completerMartin Odersky2016-05-231-4/+4
| | | | | | | | | | | | | | | | | | Otherwise we might get a false owner if completing from somewhere else. We do not have a failing test to demonstrate the problem, but it looks like the right thing to do.
| * | Refine owner trees for templatesMartin Odersky2016-05-231-1/+1
| | | | | | | | | | | | | | | Include member defs inside templates in the enclosing class, otherwise they would get localDummy as onwer.
| * | Adopt new scheme for handling forward references in TastyMartin Odersky2016-05-231-66/+106
| | | | | | | | | | | | | | | Instead of stubbing with potentially wrong owners and hping for the best, we now compute owners on demand, using the lazy data structure of an OwnerTree.
| * | Maintain ownerTree data structure when unpickling TastyMartin Odersky2016-05-233-6/+87
| | | | | | | | | | | | | | | | | | First step for a more robust scheme to access symbols in Tasty. This entailed a swap of two fields in RefiendType, to make tree format more uniform in what concerns where references are found.
| * | Let createSymbol return a symbolMartin Odersky2016-05-232-23/+27
| | | | | | | | | | | | | | | | | | Compute initialization flags of possibly enclosing traits elsewhere (in indexStats). Cleans up the logic and makes the module more understandable.
| * | Make sure delayed Tasty unpicklings are done at the latest at Pickler phaseMartin Odersky2016-05-231-4/+6
| | |
| * | Fix withPhaseNoLaterMartin Odersky2016-05-231-1/+1
| | | | | | | | | | | | | | | It's possible that the given phase argument does not exist, in which case we do not want to set the current phase to NoPhase.
| * | Make sure local data is unpickled at right phaseMartin Odersky2016-05-231-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had a problem where unpickling an annotation containing a class constant had the wrong type. Unpickling was done after erasure. The type given to the constant was an alias but aliases got eliminated during erasure, so the constant was malformed. Unpickling annotation contents at the same phase as unpickling the annotation carrier solves the problem. It seems similar problems can arise when data is unpickled using a LocalUnpickler. So we now make sure local unpickling runs at the latest at phase Pickler.
| * | Don't force a symbol's denotation for isTerm/isTypeMartin Odersky2016-05-232-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Forcing it led to CyclicReferences involving RefChecks.OptLevelInfo when compiling dotc/*.scala against Tasty files. The problem was that when transforming OptLevelInfo the backend forced a transformInfo of RefChecks in TypeErasure which filtered RefCheck's scope to eliminate non-class type definitions. Without the tweak in this commit this tried to make all symbols current, and so came back to OptLevelInfo.
| * | Instrument Denotations#current to find CyclicReferenceMartin Odersky2016-05-231-1/+7
| | | | | | | | | | | | | | | Instrument Denotations#current to find CyclicReference errors arising during transforms.
| * | Disable stub checkingMartin Odersky2016-05-231-4/+13
| | | | | | | | | | | | | | | | | | | | | It caused an assertion error when separately compiling parts of dotty against TASTY information. Not sure the test achieves anything or whether it produces a false negative.
| * | Use source module ref as assumed self type when reading TastyMartin Odersky2016-05-231-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | When reading Tasty we need to pre-set the info of a class to some ClassInfoType with (as yet) unknown parents and self type. But for module classes, we need to know the source module at all time, and this gets determined by the self type. So we now produce a TermRef for the assumed self type of a module class.
* | | Merge pull request #1256 from felixmulder/topic/test-bcodeDmitry Petrashko2016-05-272-1/+3
|\ \ \ | | | | | | | | Add bytecode checking infrastructure
| * | | Move `stripAnnots` to `isRef` instead of performing explicitly everywhereFelix Mulder2016-05-191-1/+1
| | | |
| * | | Fix #1258: correct behavior for annotated valuesFelix Mulder2016-05-171-0/+2
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | 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.
* | | Move eqAny to PredefMartin Odersky2016-05-231-3/+3
| | |
* | | Safe equality for core classes:Martin Odersky2016-05-234-0/+8
| | | | | | | | | | | | | | | | | | | | | Name, Symbol, Denotation, Type. This uncovered two nonsensical comparisons, one in CollectEntryPoints, the other in DottyBackendInterface.
* | | Check equality that with == and != makes senseMartin Odersky2016-05-231-1/+1
| | | | | | | | | | | | | | | | | | This is done by checking each instance of an eqAny implicit so that it does not contain non-bottom instances of equality types as instances.
* | | Hooks to check that comparisons with == / != make senseMartin Odersky2016-05-232-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, check that pattern matching against idents/selects/literals makes sense. The hooks perform an implicit search for an instance of `Eq[L, R]`, where `L`, `R` are the argument types. So far this always succeeeds because Eq.eqAny matches all such types. A separate commit will check the returned search term for validity.
* | | Downwards comparisons for implicit search and overloading resolutionMartin Odersky2016-05-231-0/+3
| |/ |/| | | | | | | | | | | | | | | 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 dotc bootstrap failureMartin Odersky2016-05-191-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Refined handling of atSignatureMartin Odersky2016-05-182-24/+28
| | | | | | | | | | | | | | | | | | | | We cannot throw a merge error if atSignature does not give a unique single denotation. Counter example is compiling dotty itself, where we get a false negative during bridge generation. Instead, atSigature needs to return a normal denotation, and we need to check separately where required that a denotation is in fact a SingleDenotation.
* | Issue MergeError exception for double def situationsMartin Odersky2016-05-181-8/+29
| | | | | | | | | | | | | | | | When finding two symbols in the same class that have the same signature as seen from some prefix, issue a merge error. This is simpler and more robust than the alternative of producing an overloaded denotation and dealing with it afterwards.
* | Avoid merging denotations of different symbols in same classMartin Odersky2016-05-181-1/+8
|/ | | | | | | | #1240 shows that we need to detect ambiguous overloads of methods coming from the same base class (with different signatures there) that have the same signature in some deriving class. This was undetected before because the two methods were simply merged into one overloaded alternative.
* Refine todo commentMartin Odersky2016-04-291-1/+1
|
* Dealias more types in resultTypeMartin Odersky2016-04-271-26/+31
| | | | | Since we now recognize more false dependencies, we have to dealias the new dependencies accordingly.
* Add FurtureDefsOK for isBottomTypeMartin Odersky2016-04-271-1/+7
| | | | | | Triggered by change in TypeComparer. I guess we should think of dropping the NotDefiendHere tests, for a long time they gave us only false negatives.
* Fix misprediction of dependent method type status.Martin Odersky2016-04-271-7/+10
| | | | | | | | | #1235.scala contains a case of a method type of the form (x: T) ... x.tail.N ... where N is an alias. We need to follow the alias to prevent a mischaracterization that this is a dependent method type.
* Avoid forming ???.T type.Martin Odersky2016-04-271-1/+2
| | | | | | More generally, avoid forming a type selection on a term prefix which has a bottom class as a type. There might be other places where we have to take similar measures. For now, this one fixes #1235.
* Rename Reporting#println -> Reporting#echoMartin Odersky2016-04-272-5/+5
| | | | | | | | | | There's a trap otherwise that, when in a class inheriting from Context (and with it Reporting) a call to println will go to this.println and therefore might not print at all, if the current context buffers messages. I lost a lot of time on this on several occasions when I scratched my head why a simple debug println would not show. Better avoid this in the future for myself and others.
* Support implicitNotFound annotationMartin Odersky2016-04-221-0/+2
|