aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/config/Config.scala
Commit message (Collapse)AuthorAgeFilesLines
* Make positions fit for metaMartin Odersky2016-09-241-0/+3
| | | | | | | | | | | | | | | | | | In particular: - get rid of envelope, it's too complicated and hides too many errors - check that everywhere in parsed trees the position range of a parent node contains the position ranges of its children. - check that all non-empty trees coming from parser have positions. The commit contains lots of fixes to make these checks pass. In particular, it changes the scheme how definitions are positioned. Previously the position of a definition was the token range of the name defined by it. That does obviously not work with the parent/children invariant. Now, the position is the whole definition range, with the point at the defined name (care is taken to not count backticks). Namer is changed to still use the token range of defined name as the position of the symbol.
* HK reduction: Remove special-case for typerefsGuillaume Martres2016-07-181-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The special case: case stripped: TypeRef => stripped.symbol.is(BaseTypeArg) is wrong because you might still want to reduce applications involving TypeRefs which are not base class parameters, like in: class Foo[A] type Alias[X] = Foo[X] val x: Alias[Int] = ??? `Alias` is a TypeRef so before this commit `Alias[Int]` was never reduced to `Foo[Int]`. It should have been: case stripped: TypeRef if stripped.symbol.is(BaseTypeArg) => true But even this is incorrect: it assumes that we can always safely reduce HK applications involving base class parameters, this is not the case when the parameter kind is different from the rhs kind as illustrated by `i1181c.scala`. We fix this by simply dropping the special case.
* Fix bounds checking of hk applied typedMartin Odersky2016-07-141-3/+2
| | | | | Previous logic could only handle classes as constructors. Also, address other reviewers comments.
* Make rewritings of hk applications configurableMartin Odersky2016-07-131-0/+7
| | | | | | | | | Beta-reduce only if `Config.simplifyApplications` is true. Turning off beta-reduction revealed two problems which are also fixed in this commit: 1. Bad treatement of higher-kinded argyments in cyclicity checking 2. Wrong variance for higher-kinded arguments in TypeAccumulator
* Drop Config.checkKindsMartin Odersky2016-07-111-7/+0
| | | | | Allows us to drop also the involved knownHK method. Lots of other cleanups.
* Cleanup of Signature matchingMartin Odersky2016-07-111-3/+3
| | | | | Eliminate sameParams, add comments. Also, minor cleanups elsewhere.
* Remove refinement encoding of hk typesMartin Odersky2016-07-111-2/+0
| | | | | | | | | | Remove the code that implemented the encoding of hk types using refinements. Drop the notion that RefinedTypes can be type parameters. This is no longer true under the new representation. Also, refactoring MemberBinding -> TypeParamInfo
* Drop assertion in TypeMapMartin Odersky2016-07-111-3/+5
| | | | | | | The deleted assertion could fail for code that was erroneous. - Enable new hk scheme.
* Start new, direct HK schemeMartin Odersky2016-07-111-0/+2
| | | | | - Re-introduce newHK option. Label some things that will be removed with OLD.
* Remove old hk schemeMartin Odersky2016-07-111-2/+0
| | | | | | | | | | | | - Simplify RefinedType - Drop recursive definition of RefinedThis - this is now taken over by RecType. - Drop RefinedThis. - Simplify typeParams The logic avoiding forcing is no longer needed. - Remove unused code and out of date comments.
* Optionally, check kinds match for & and |Martin Odersky2016-07-111-0/+5
| | | | Optionally, check kinds of operands of & and | match.
* Turn on new hk schemeMartin Odersky2016-07-111-1/+1
| | | | | | | For the moment under newHK flag. - avoid crasher in derivedTypeParams (NamedTypes don't always have symbols) - Revise logic in type comparer for new HK scheme
* New type lambda scheme for hk typesMartin Odersky2016-07-111-0/+2
|
* Fix documentation of Config.checkConstraintsSeparatedGuillaume Martres2016-02-081-4/+4
|
* Fix docs and namingMartin Odersky2016-02-051-4/+5
|
* Don't force symbol denotation when taking fingerprint.Martin Odersky2016-01-191-1/+1
|
* Optionally rewrite projections.Martin Odersky2015-12-151-0/+9
|
* Eliminate Config.newMatch optionMartin Odersky2015-09-291-6/+0
| | | | | With the new approach to matching it is no longer sound. We always have to match infos anyway to be sure.
* Eta expand $apply projected types if neededMartin Odersky2015-09-211-0/+5
| | | | | | | | | | | | | | | | It turns out that asSeenFrom can produce types that get projected with $apply but that are not higher-kinded. An exampple failure is in Iter3, andother in scala.collection.immutable.Map (which is now part of the test suite). We now detect that situation, and eta expand the projected type in `derivedSelect`, this will force a subssequent `lookupRefined` which will give the desired normalized type. Also added is a configurable test that checks that $apply projected tyeps are in fact higher-kinded.
* Disable checkConstraintClosed by defaultMartin Odersky2015-06-261-2/+10
| | | | | | | Checking that constraints are closed caused cyclic reference exceptions in DottyBackedInterface. What's worrying is that these were seemingly not checked by the checkin tests. Or maybe there is some dependcy on compilation order that triggers the erros only in my setup.
* Avoid junk produced by Constraint#replace.Martin Odersky2015-06-221-0/+3
| | | | | | | | | | | | | | There were two instances where a constraint undergoing a replace would still refer to poly params that are no longer bound after the replace. 1. In an ordering the replaced parameters was n ot removed from the bounds of the others. 2. When a parameter refers to the replaced parameter in a type, (not a TypeBounds), the replaced parameter was not replaced. We now have checking in place that in globally committable typer states, TypeVars are not instantiated to PolyParams and (configurable) that constraints of such typer states are always closed. Fixes #670.
* Deskolemize types inferred for vals and defsMartin Odersky2015-06-061-0/+5
| | | | | | | We want to establish the invariant (optionally checked by assertNoSkolems) that symbols do not contain skolemized types as their info. This avoids unsoundness situations where a skolem gets exported as part if the result type of a method, so different instantiations look like their are the same instance.
* Calibrate findMember logging thresholds and test caseMartin Odersky2015-05-211-3/+11
| | | | | | | | | | | | Adds IterableSelfRec.scala which caused lockup of the compiler. After a lot of work the problem was determined to be polyomial or exponential behavior of the compiler when executing findMember on refined types that contain several bindings where the resutling & causes a recursive invokation of findMember with the same name. We do have a stop for this now, but if the stop comes too late the runtime will grow very fast. Problem addressed by kiccking in earlier with the stopping logic.
* Move threshold values to ConfigMartin Odersky2015-05-211-0/+19
| | | | It's a more logical home for them than the Context object.
* Correct a large number of typos.Jason Zaugg2015-05-141-2/+2
| | | | | I scanned the main sources with IntellIJ's spell checker and corrected what showed up.
* Remove trailing spaces in Dotty source.Dmitry Petrashko2015-04-091-6/+6
|
* Make all Dotty source files end in newline.Dmitry Petrashko2015-04-091-1/+1
|
* Cleanups prompted by reviews.Martin Odersky2015-01-281-1/+1
|
* New constraint implementation: OrderingConstraintMartin Odersky2015-01-241-1/+1
| | | | | | | This is one both a bit simpler and a faster than TrackingConstraint. Main change is to replace the 2-d bitmap for ordering with two SimpleMaps which record for each parameter the smaller and greater parameters. This is faster in practice because the ordering relation is sparse.
* Make checkPropagated configurableMartin Odersky2015-01-191-0/+6
| | | | Only run if a config option is set.
* New constraint handlingMartin Odersky2015-01-181-6/+0
| | | | | | | | New constraint handling scheme using constraints that distinguish more between parameter and non-parameter bounds and which track parameter bounds separately. This allows a co-inductive formulation of satisfiability checking without fishy cyclicity checks. It should also scale better for long chains of dependent type variables.
* Made refinement subtype fastpath insensitive to RefineedThis#binder.Martin Odersky2015-01-091-1/+1
| | | | | | | | Since the binder field in RefinedTypes should not be significant for subtyping, we need to substitute RefinedThis types away before comparing refinements. But this substitution is only done in the slow path. The fix falls back to the slow path if a refinement refers to the refined type via a refined this.
* More aggressive reduction in lookupRefinedThis.Martin Odersky2015-01-091-1/+1
| | | | See comment for an example what changes.
* Made fast path for refined subtype checking configurable.Martin Odersky2015-01-091-0/+4
| | | | | A configuratin now decides whether fast path is taken or not. That way we can more easily test either way if something goes wrong.
* Fix problem in constraint handlingMartin Odersky2015-01-091-0/+5
| | | | | | | | | | | | | | | | | | After last commit, dotc/config died with the "isSatisfiable" assertion in TypeComparer. The problem was that when deeling with a variable/variable constraint A <: B we treated this as the two independent actions of adding A <: B B >: A But this means we no longer have a clean inductive satisfiability check before something gets added - A <: B gets added before the satisfiability check of B >: A is started. The fix splits satisfiability check and actual constraint update in two separate actions.
* Remove choice between new and old scheme for subtyping refined types.Martin Odersky2015-01-081-1/+1
| | | | Now that new scheme works we can drop the alternative.
* Add transitive check for cycles in constraints.Martin Odersky2015-01-081-1/+15
|
* Make rejection of deep subtype call stack optionalMartin Odersky2014-10-111-3/+0
| | | | | | Move flag that throws exception on deep subtyping stacks from Config varianble to setting. Disable setting for core-pickling which had a deep subtype failure after pattern matcher was integrated. Todo: Figure out why the subtype stack got so deep.
* @odersky have a look.Dmitry Petrashko2014-09-231-1/+1
| | | | testOnly dotc.tests
* Make type creators work for erased types.Martin Odersky2014-08-241-0/+3
| | | | | | | | - Some types are different when erased (e.g. prefixes are NoPrefix) - Some types are forbidden when erased. Put in assertions to check that fact. Also, some renaming and doc comments to make creation of TermRefs and TypeRefs clearer.
* Optionally check variance of Lambda classes.Martin Odersky2014-06-121-1/+6
| | | | | Make sure that Lambda Arg refinements have the same variance as the Lambda classes they instantiate. Controlled by a Config parameter.
* Adding dependency tracking to constraint satisfactionMartin Odersky2014-05-081-0/+6
| | | | | | | | The previous scheme checked all constraint bounds twice everytime the bounds for a parameter in a constraint were changed. The new scheme, which can be disabled by unsetting `Config.trackContrDeps`, only checks those cbounds that directly or indirectly mention the changed parameter.
* Shadowed referencesMartin Odersky2014-04-081-2/+2
| | | | | | | | | | | | | | | | | | | In TypeAssigner#ensureAccible we sometimes pick an inherited public member as the denotation of a NamedType instead of an inaccessible private one. The problem is that both are denotations for the same type, which caused a noDoubleBindings assert failure. We now solve this problem by creating a "shadowed" named type to hold the inherited member. The shadowed named type is distinguished by its name, which reads (inherited)originalName In the future, we should make this more robust by using a general tagging scheme to create shadowed names. Another fix is about import symbols. They are now referenced with NonMemberTermRefs. With this fix, the test suite passes with no double def violations.
* Reworked TermRef handlingMartin Odersky2014-04-081-0/+7
| | | | | | | | | | | | | | | The main problem with TermRef handling was that signatures were not always tracked correctly. New invariant: A TermRef that points to a symbol is always a TermRefWithSig, and the signature is the one of the corresponding member. We achieve this by sometimes generating a new TermRefWithSig if a TermRef gets a denotation. One possible simplification would be to always store a signature in a TermRef. There's still a problem in TermRefWithSig#newLikeThis, which currently works only if the previously stored denotation references a symbol. We will need to generalize JointRefDenotation to contain multiple symbols for a complete fix.
* Summary printingMartin Odersky2014-03-291-0/+3
| | | | | | Added general way to produce summaries when shwowing trees or types. Summaries have limited, configrable recusion depth. fix showSummary
* Fix bug for reading type arguments in ClassfileParserMartin Odersky2014-02-061-0/+2
|
* Fixes to constraint handling.Martin Odersky2014-01-261-1/+5
| | | | | | | | In particular, need to unify polyparams before replacing one with the other, if the result wiould lead to a cyclic constraint. Also: Avoid setting `inst` field of a type variable if a subtype operation is in progress, because the constraint might be retracted, and the instantiation should be retracted with it. Third, tighter checks of cyclic constraint, and deep subtype recursions can now be demanded to cause an abort.
* New subtype constraint maintenance algorithm.Martin Odersky2014-01-071-0/+2
| | | | | | | | | | Objective: Avoid cycles by detecting all cases where A <: B and B <: A and removing those cases by unifuing A and B. Cycles need to be avoided because they lead to deep subtype recursions.
* Make implicit scope work in the presence to TypeVarsMartin Odersky2014-01-061-0/+1
| | | | Need to pass a current context to be able to find instances of typevars.
* Output cleanupsMartin Odersky2014-01-041-0/+2
|