aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/transform
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | Remove unreachable `tupleExtractor` methodOlivier Blanvillain2017-03-301-22/+1
| | | |
| * | | Remove dead code from pattern matcherOlivier Blanvillain2017-03-301-87/+2
| |/ / | | | | | | | | | Starting from unreachable case https://github.com/lampepfl/dotty/blob/f75caad00256db52bbd3310f245e51d23c2a76cc/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala#L1408
* | | PatMat, Outerchecks: Check outers for selections from singleton type.Dmitry Petrashko2017-03-301-3/+4
| | | | | | | | | | | | | | | Otherwise checks are done also on type projections. Same pitfall as https://issues.scala-lang.org/browse/SI-7214
* | | PatMat: get rid of unnecessary forwarderDmitry Petrashko2017-03-301-8/+2
| | |
* | | Fix #2165, emit outerChecks on ThisTypeDmitry Petrashko2017-03-301-2/+2
|/ / | | | | | | | | | | ThisType doesn't have a termSymbol. And the check is actually too strong, and not needed.
* | Only use shadowed when necessaryMartin Odersky2017-03-201-7/+8
| |
* | Use shadowing to reference inherited accessors.Martin Odersky2017-03-201-3/+9
| | | | | | | | | | | | Normal references won't work since the referenced accessor has the same name as a private name in the class defining the forwarder. This showed up as pickling failures under separate compilation.
* | Fix #2084.Dmitry Petrashko2017-03-201-5/+12
| |
* | Merge pull request #2058 from dotty-staging/fix-2054liu fengyun2017-03-182-2/+8
|\ \ | | | | | | Fix #2054
| * | fix typo in commentliu fengyun2017-03-181-1/+1
| | |
| * | Fix a stupid error in fix of #2054.Dmitry Petrashko2017-03-132-4/+7
| | |
| * | Fix #2054: @Static methods may access synthetic private methods stuffDmitry Petrashko2017-03-071-0/+3
| |/ | | | | | | | | | | Due to way how we desugar lambdas, we can decide to make a lambda static Static methods could refer to those lambdas and we need to make them public
* | Merge pull request #2043 from dotty-staging/tailrec-derivesFromDmitry Petrashko2017-03-152-3/+7
|\ \ | | | | | | Tailrec for derivesFrom/lookupRefined/classSymbol/classSymbols
| * | Add @tailrec to avoid regressions.Nicolas Stucki2017-03-012-3/+7
| |/
* | Merge pull request #2079 from dotty-staging/depmeth2odersky2017-03-1410-32/+34
|\ \ | | | | | | Allow inter-parameter dependencies
| * | Fix unrelated typos in commentsMartin Odersky2017-03-141-6/+6
| | |
| * | Drop mixed MethodType apply methodMartin Odersky2017-03-141-2/+3
| | | | | | | | | | | | | | | | | | The dropped method takes direct parameter types but a result type expression. Since parameter types are now in general dependent as well, that method is mostly redundant.
| * | Construct MethodTypes from parameter closureMartin Odersky2017-03-149-24/+25
| | | | | | | | | | | | | | | To allow for dependencies between method type parameters, construct MethodTypes from a closure that maps the currently constructed MethodType to its parameter types.
* | | Merge pull request #2091 from dotty-staging/fix-#2077Guillaume Martres2017-03-141-0/+9
|\ \ \ | |/ / |/| | Fix #2077: Optimization of constant conditionals
| * | Fix #2077: Optimization of constant conditionalsMartin Odersky2017-03-131-0/+9
| | | | | | | | | | | | | | | Move fixed logic to FirstTransform, where the other constant folding operations are also done.
* | | fix #1488: unfriendly jumping in evaluating lazy val blockliu fengyun2017-03-141-1/+1
|/ /
* | Merge pull request #2078 from dotty-staging/fix-#1569-v2Guillaume Martres2017-03-121-1/+1
|\ \ | | | | | | Fix #360: Improve avoidance algorithm
| * | Improve definition and doc comment for ensureNoLeaksMartin Odersky2017-03-121-1/+1
| | | | | | | | | | | | No more try-again business necessary.
* | | ElimRepeated: Do not use installAfterGuillaume Martres2017-03-121-6/+14
| | | | | | | | | | | | | | | | | | | | | This was a mistake introduced in the previous commit, installAfter is only safe to use in `IdentityDenotTransformer` phases, otherwise it means that the phase denotation transformer is not run at all for this particular denotation, this caused Ycheck to fail.
* | | Fix overriding a Java method with varargsGuillaume Martres2017-03-121-2/+7
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If A method like: override def foo(x: Object*) overrides a Java method, it needs to be rewritten as: def foo(x: Seq[Object]) override def foo(x: Array[Object]): Object = foo(Predef.wrapRefArray(x)) This should be handled by ElimRepeated but there were two bugs: - `addVarArgsBridge` was called at phase `thisTransformer.next`, this is too late to create the bridge since `T*` has already been rewritten as `Seq[T]` - The original method symbol needs to have the `override` flag dropped, since it doesn't override anything. Furthermore, RefChecks had to be moved after ElimRepeated, otherwise the testcase would fail the overriding checks.
* / Remove uses of Collections from scala-reflectGuillaume Martres2017-03-082-8/+4
|/
* Merge pull request #2017 from dotty-staging/refchecks-less-slowodersky2017-02-251-2/+8
|\ | | | | Make resolveSuper less slow
| * ResolveSuper: MixinOps save 2-3 seconds on stdlib compilation.Dmitry Petrashko2017-02-211-2/+8
| | | | | | | | | | By ordering tests in a smarter way. Add leave a big scary comment.
* | Merge pull request #1974 from dotty-staging/fix/ctx-captureodersky2017-02-211-1/+1
|\ \ | | | | | | Avoid accidental captures of Context
| * | TailRec: Avoid harmless capture of ContextGuillaume Martres2017-02-181-1/+1
| | | | | | | | | | | | | | | | | | The captured context was passed implicitly to dd.rhs, atGroupEnd is always run with the same runId as the captured context so this should be okay, but it's better to avoid using two contexts in the same expression anyway.
* | | Merge pull request #1984 from dotty-staging/fix-#1747-v2odersky2017-02-211-2/+3
|\ \ \ | | | | | | | | Fix #1747: Improve error message for Scala/Java type mismatch
| * | | Avoid automatism for passing variances to PolyTypesMartin Odersky2017-02-141-2/+3
| | |/ | |/| | | | | | | | | | We used to "fill-in" with zeroes if variances were missing. I now think that;'s too error-prone. Better define all variances explicitly.
* | | Harden outer proxy computation of inlined codeMartin Odersky2017-02-193-19/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that we simply cannot do reliable outer path computation that fills in the right hand sides of this-proxies from the types of these proxies. As-seen-from logic can mangle the types of proxies enough to scramble the necessary information. What we now do instead is simply count: We record the number of outer accesses to an outer this in inlineable code, and do the same number of outer accesses when computing the proxy.
* | | Fix default parameter value.Martin Odersky2017-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | Interesting that the tests pass even if we always assume outOfContext = true. So this raises the question why have a flag? It's just that I am not sure the `outOfContext` behavior is correct in all cases. So I prefer to be conservative here.
* | | Fix #1990: Handle case where inlining changes class of outerMartin Odersky2017-02-182-5/+16
| |/ |/| | | | | | | | | | | | | | | | | The new situation in the test was that outer of the inlined method was `A` but it's as seen from type is a subtype `B`. We need two fixes: - Ignore outerSelects in TreeChecker. These are treated as having fixed symbols. - Adapt the outer-path logic to deal with code that's moved to another context.
* | Add checks for synthetic functions and erased functions.Nicolas Stucki2017-02-132-5/+3
|/ | | | | | | | * Add `isSyntheticFunction` checks for synthetic functions such as FuntionN for N > 22 and ImplicitFunctionN for N >= 0. * Add `erasedFunctionClass` to get the erased verion of synthetic functions. * Change the semantics of `isFunctionClass` to return true if it is any kind of FunctionN or ImplicitFunctionN.
* Merge pull request #1936 from dotty-staging/fix-1916-on-implicit-functionsodersky2017-02-081-2/+2
|\ | | | | Fix #1916: fix erasure of implicit xxl closures
| * Fix #1916: fix erasure of implicit xxl closuresNicolas Stucki2017-02-031-2/+2
| | | | | | | | This commit extends the fix done in #1920 to implicit closures.
* | Represent untyped operators as Ident instead of NameGuillaume Martres2017-02-051-2/+0
|/ | | | | | | | This has two advantages: - We can distinguish BackquotedIdent from Ident, allowing the user to use a defined "type `&`", see testcase. - We get better positions for the operators. This is useful in IDEs, for example to get the type at point.
* Merge pull request #1874 from dotty-staging/topic/dottydoc-markdownFelix Mulder2017-02-021-13/+14
|\ | | | | [doctool] Add markdown support && Static site generation
| * Make sure overriden members w/o docstring inherit by defaultFelix Mulder2017-02-011-1/+0
| |
| * Fix javadoc indentation style parsingFelix Mulder2017-01-311-26/+26
| |
| * Document `IsInstanceOfEvaluator` using markdown style docstringsFelix Mulder2017-01-311-28/+30
| |
* | Merge pull request #1922 from dotty-staging/fix-#1723odersky2017-02-021-6/+0
|\ \ | | | | | | Fix-#1723: Avoid private leaks on completion
| * | Fix-#1723: Avoid private leaks on completionMartin Odersky2017-02-011-6/+0
| | | | | | | | | | | | As #1723 demonstrates, doing this at PostTyper is too late.
* | | Merge pull request #1919 from dotty-staging/fix-#1915Nicolas Stucki2017-02-011-1/+1
|\ \ \ | |_|/ |/| | Fix #1915 Synthetic function traits need NoInits flag
| * | Make it known that FunctionXXL does not have an initializer.Martin Odersky2017-02-011-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | When compiled from Scala2 that knowledge was lost. Normally that would be not a problem (e.g. the same thing happens for Function0-22). But FunctionXXL is special in that it is inherited only after erasure. Since `augmentScala2Trait` runs before erasure, it is having no effect on FunctionXXL itself when running on classes that inherit function types of large arities. Therefore, FunctionXXL is missing an implementation class at phase Mixin, which means that the supercall logic which rewires super.<init> to implementation class init cannot work. This leaves us with a super.<init> to FunctionXXL in `i1915.scala`. The fix is to always know that `FunctionXXL` has no init method, so no super.<init> will be generated for it.
* / Fix #1916 - fix erasure of xxl closuresMartin Odersky2017-01-311-1/+3
|/ | | | | xxl closures need to get the SAM type FunctionXXL as their explicit type field after ersure.
* Fix #1750: Handle illegal class overrides betterMartin Odersky2017-01-291-4/+13
| | | | | | | | | | | | | | | | | | Illegal class overrides are fundamentally at odds with the way dotty represents types and therefore can cause lots of low-level problems. Two measures in this commit First, we detect direct illegal class overrides on completion instead of during RefChecks. Break the override by making the previously overriding type private. This fixes i1750.scala, but still fails for indirect overrides between two unrelated outer traits/classes that are inherited by the same class or trait. We fix this by catching the previously thrown ClassCastException in both ExtractAPI and RefChecks. Test case for indirect overrides is in i1750a.scala.
* Merge pull request #1896 from dotty-staging/fix/bootstrapGuillaume Martres2017-01-282-3/+12
|\ | | | | Add sbt-based bootstrap