aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/transform
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* 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
| * Workaround #1895: Bringing a symbol to a new run is brokenGuillaume Martres2017-01-281-2/+7
| |
| * Workaround #1770: Run changeOwner at group end in ElimByNameGuillaume Martres2017-01-281-1/+5
| | | | | | | | | | Using changeOwnerAfter would be more appropriate but currently fails with an assertion in LambdaLift
* | Fix #1687: postpone computations in tailrec until they are needed.Dmitry Petrashko2017-01-221-34/+39
|/ | | | | | | | | Previous version precomputed everything needed to make the final decision. This was fast-path for method that will be tail-rec transformed. Unfortunatelly, in case decision was not to tail-rec optimize it could have led to exponential number of transformations. Now, the fast-path is for methods that will not.
* Merge pull request #1883 from dotty-staging/fix-1877Dmitry Petrashko2017-01-113-6/+83
|\ | | | | Fix #1877: Add forwarders for primitive/generic mixins.
| * Add PrimitiveForwarders and fix forwarding on value classes.Nicolas Stucki2017-01-113-15/+55
| |
| * Fix #1877: Add forwarders for primitive/generic mixins.Nicolas Stucki2017-01-062-6/+43
| |
* | Fix #1878: Use Inline on final vals.Nicolas Stucki2017-01-101-20/+5
| |
* | Stop emitting fields for inlined fields.Nicolas Stucki2017-01-101-1/+2
| |
* | Revert "Fix #1878: Generate fields for final vars."Nicolas Stucki2017-01-101-1/+1
|/ | | | This reverts commit 63d68bf4d3cbac82f6d9faf19acd5589603a17ee.
* Merge pull request #1873 from dotty-staging/fix-#1865odersky2017-01-051-1/+2
|\ | | | | Fix #1865: Compute outer path at right phase
| * Address reviewer commentsMartin Odersky2017-01-041-1/+1
| |
| * Fix #1865: Compute outer path at right phaseMartin Odersky2017-01-031-1/+2
| | | | | | | | | | When computing the outer path, we need to be careful to dealias before erasure, even if the outer path is demanded during erasure. Otherwise we lose prefixes.
* | Fix #1878: Generate fields for final vars.Nicolas Stucki2017-01-051-1/+1
| |
* | Fix #1732: Special treatment for bottom type by-name argsMartin Odersky2016-12-311-1/+2
|/ | | | | | If a by-name arg has a bottom type, we need to create a closure with the result type of the formal parameter, or else specialization with FunctionalInterfaces will fail.
* Fiddling with wideneningMartin Odersky2016-12-212-2/+2
| | | | | | Fixing two failures in stdlib having to do with widening. In both cases, a widenIfUnstable was required. One was widening too much, the other too little.
* Fix super accessor generationMartin Odersky2016-12-201-15/+18
| | | | | | | We looked under the wrong signature before, which meant that we sometimes would not detect that a super accessor existed already and generate a duplicate. Observed when compiling stdlib's collection/mutable/ObservableMap.scala.
* Merge pull request #1821 from dotty-staging/fix-i1820odersky2016-12-201-7/+13
|\ | | | | Fix #1820: make sure outer of traits implemented
| * address review: rename hasOuterFlag to clsHasOuterliu fengyun2016-12-201-3/+3
| |
| * refine previous commitliu fengyun2016-12-191-2/+2
| |
| * Fix #1820: condition of whether generates outerliu fengyun2016-12-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we don't generate `outer` for the anonymous class `new Inner2 {}`. This is incorrect, as `Inner2 {}` extends `A.Inner`, which requires an outer. trait A { val a = "a" trait Inner { def f = println(a) def h = 3 } } trait B extends A { trait Inner2 extends Inner new Inner2 {} }
| * fix #1820: make sure outer of traits implementedliu fengyun2016-12-181-7/+12
| |
* | Merge pull request #1775 from dotty-staging/add-implicit-funtypesodersky2016-12-182-13/+180
|\ \ | |/ |/| Add implicit function types
| * Fix commentMartin Odersky2016-12-171-1/+1
| |
| * Fix typo in commentMartin Odersky2016-12-171-1/+1
| |
| * Drop Override flag for non-overriding direct methodsMartin Odersky2016-12-171-2/+5
| | | | | | | | Also, integrate Jason's test case with the conditional.
| * Make specialization tweakableMartin Odersky2016-12-171-3/+22
| | | | | | | | | | Introduce an option to not specialize monomorphic targets of callsites.
| * New ShortcutImplicits phaseMartin Odersky2016-12-171-0/+143
| | | | | | | | | | Optimizes implicit closures by avoiding closure creation where possible.
| * Fix erasure of implicit functionsMartin Odersky2016-12-171-13/+15
| | | | | | | | and check at runtime that it works
* | Merge pull request #1767 from dotty-staging/fix-#1755odersky2016-12-171-2/+21
|\ \ | |/ |/| Fix #1755: Make sure references in outer args are accessible
| * Fix #1755: Make sure references in outer args are accessibleMartin Odersky2016-12-021-2/+21
| | | | | | | | | | | | | | Needed a fixup action in ExplicitOuter to avoid references to module's This from outside their scope. The problem is fixed, but I wish I understood better the root cause.
* | Merge pull request #1811 from dotty-staging/fix-1810odersky2016-12-161-1/+1
|\ \ | | | | | | Fix #1810 LazyVals should use changeOwnerAfter.
| * | Fix #1810 LazyVals should use changeOwnerAfter.Dmitry Petrashko2016-12-151-1/+1
| | |
* | | Merge pull request #1763 from dotty-staging/fix/annotationsDmitry Petrashko2016-12-161-3/+7
|\ \ \ | | | | | | | | Fix emission of annotations
| * | | Fix transformation of inline body annotationsGuillaume Martres2016-11-301-3/+7
| | | | | | | | | | | | | | | | | | | | Previously we replaced them by ConcreteAnnotation so they became regular annotations and could be emitted in some cases. They need to keep being BodyAnnotation.