aboutsummaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
* Represent untyped operators as Ident instead of NameGuillaume Martres2017-02-059-43/+44
| | | | | | | | 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 #1930 from dotty-staging/fix-#1568odersky2017-02-032-87/+94
|\ | | | | Fix #1568 - avoid transforming error trees
| * Fix #1568 - avoid transforming error treesMartin Odersky2017-02-022-87/+94
| | | | | | | | | | If a tree has type error, subtrees may not have an assigned type. Therefore we should avoid transforming such trees.
* | Weaken assumption in mergeCompanionDefsliu fengyun2017-02-021-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | Previously `mergeCompanionDefs` assumes that if the attachment of class `Foo` is as follows: x :: y :: tdef @ TypeDef(_, templ) Then the `tdef` must be `Foo$`. When there are multiple pre-typer transforms, this is not necessarily true. For example, an annotation macro expansion may expand a non-case class `Foo` to `class Foo; object FooA`. We need to check the name of `tdef` to be equal to `Foo$`.
* | Merge pull request #1874 from dotty-staging/topic/dottydoc-markdownFelix Mulder2017-02-025-40/+62
|\ \ | | | | | | [doctool] Add markdown support && Static site generation
| * | Add position based error reporting to dottydocFelix Mulder2017-02-011-1/+4
| | |
| * | Make sure overriden members w/o docstring inherit by defaultFelix Mulder2017-02-011-1/+0
| | |
| * | Fix javadoc indentation style parsingFelix Mulder2017-01-312-32/+32
| | |
| * | Fix codeblocks in shortened markdownFelix Mulder2017-01-311-21/+24
| | |
| * | Add @OlivierBlanvillain to the core devsFelix Mulder2017-01-311-1/+1
| | |
| * | Allow custom project nameFelix Mulder2017-01-311-5/+5
| | |
| * | Add static site gen to dottydoc mainFelix Mulder2017-01-311-0/+7
| | |
| * | Document `IsInstanceOfEvaluator` using markdown style docstringsFelix Mulder2017-01-312-28/+37
| | |
| * | Add markdown parsing to dottydocFelix Mulder2017-01-311-0/+1
| | |
* | | Merge pull request #1627 from dotty-staging/prettyprintliu fengyun2017-02-023-2/+9
|\ \ \ | | | | | | | | fix #1626: inconsistent names in prettyprint
| * | | fix #1626: inconsistent names in -Xprintliu fengyun2017-02-023-2/+9
| | | |
* | | | Merge pull request #1928 from dotty-staging/fix-#1569odersky2017-02-021-1/+1
|\ \ \ \ | | | | | | | | | | Fix #1569: Fix logic for by-name parameters of inline methods
| * | | | Fix #1569: Fix logic for by-name parameters of inline methodsMartin Odersky2017-02-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | As #1569 shows, by-name parameters should be treated in the same way as by-value parameters. If the expression is not pure, install a binding.
* | | | | Merge pull request #1923 from dotty-staging/f-interpolatorliu fengyun2017-02-021-3/+8
|\ \ \ \ \ | | | | | | | | | | | | avoid using macro-based StringContext.f to ease bootstrap
| * | | | | avoid using macro-based StringContext.f to ease bootstrapliu fengyun2017-02-021-3/+8
| | |/ / / | |/| | |
* | | | | Merge pull request #1929 from dotty-staging/multi-levelodersky2017-02-021-2/+4
|\ \ \ \ \ | |_|_|_|/ |/| | | | support pre-typer transform of trees
| * | | | support pre-typer transform of treesliu fengyun2017-02-021-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently `mergeCompanionDefs` assume `ModuleDef` is expanded exactly to `module val; module class`. To enable more general pre-typer transform, we need to weaken the assumption to that the first two elements of the thicket must be `module val; module class`. This change will enable transform def macros defined inside an object, as well as other pre-typer transforms.
* | | | | Merge pull request #1922 from dotty-staging/fix-#1723odersky2017-02-024-14/+12
|\ \ \ \ \ | |_|_|/ / |/| | | | Fix-#1723: Avoid private leaks on completion
| * | | | Fix typoMartin Odersky2017-02-021-1/+1
| | | | |
| * | | | Refactoring to make Checking not mutate denotationsMartin Odersky2017-02-024-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | avoidPrivateLeaks got moved from Checking to TypeAssigner, where it fits well besides the other avoid methods.
| * | | | Fix-#1723: Avoid private leaks on completionMartin Odersky2017-02-013-11/+6
| | | | | | | | | | | | | | | | | | | | As #1723 demonstrates, doing this at PostTyper is too late.
* | | | | Merge pull request #1925 from dotty-staging/fix/inner-vcodersky2017-02-021-0/+2
|\ \ \ \ \ | |_|/ / / |/| | | | Fix #1644: Disallow inner classes in value classes
| * | | | Fix #1644: Disallow inner classes in value classesGuillaume Martres2017-02-011-0/+2
| | | | |
* | | | | Merge pull request #1919 from dotty-staging/fix-#1915Nicolas Stucki2017-02-014-6/+15
|\ \ \ \ \ | |_|_|/ / |/| | | | Fix #1915 Synthetic function traits need NoInits flag
| * | | | Add explanation to NoInitClassesMartin Odersky2017-02-011-0/+10
| | | | |
| * | | | Make it known that FunctionXXL does not have an initializer.Martin Odersky2017-02-012-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | Drop atPhaseNotLaterThanTyperMartin Odersky2017-02-012-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | It was used only once and its body is almost as short as the name, so no need to have a separate method.
| * | | | Fix #1915 Synthetic function traits need NoInits flagMartin Odersky2017-01-311-1/+1
| | |/ / | |/| | | | | | | | | | Fixes #1915.
* | | | Merge pull request #1881 from dotty-staging/add-structural-selectodersky2017-02-015-6/+95
|\ \ \ \ | | | | | | | | | | Implement structural type member access
| * | | | Disallow polymorphic refinements in stuctural types.Martin Odersky2017-01-281-1/+3
| | | | | | | | | | | | | | | | | | | | We can't handle them with the proposed scheme. I made a note in #1886.
| * | | | Generalize test whether access is to a refinementMartin Odersky2017-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A previous type comparison was wrong because it did not map refined-this types. I believe it was also redundant, so the easiest fix is to drop it.
| * | | | Address reviewer commentsMartin Odersky2017-01-102-3/+4
| | | | |
| * | | | Change scheme to use SelectableMartin Odersky2017-01-073-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | Use base types instead of implicits. This is more robust in the presence of type abstraction.
| * | | | CleanupsMartin Odersky2017-01-052-3/+2
| | | | |
| * | | | Implement structural type member accessMartin Odersky2017-01-055-6/+93
| | | | | | | | | | | | | | | | | | | | New scheme for implementing structural type member access.
* | | | | Merge pull request #1914 from dotty-staging/fix-treemapodersky2017-02-012-1/+33
|\ \ \ \ \ | |_|_|_|/ |/| | | | Fix incorrect flatten of thicket inside interpolated string in UntpdTreeMap
| * | | | fix incorrect flatten of thicket inside interpolated string in UntpdTreeMapliu fengyun2017-01-302-1/+33
| | |_|/ | |/| |
* | | | 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-294-5/+31
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2814-80/+67
|\ \ | | | | | | Add sbt-based bootstrap
| * | sbt.ExtractDependencies: avoid false dependenciesGuillaume Martres2017-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Type#member might return a denotation that doesn't "really exists" (as defined by TypeAssigner#reallyExists), in some circumstance this denotation can refer to a symbol in a class that is in the classpath but that is not used by this file, so using addDependency on the result of Type#member might add a false dependency. We avoid this by using Type#select instead which will internally do the right thing. This issue was discovered while compiling the bootstrapped projects which would sometimes force a full recompilation for no reason.
| * | Workaround #1895: Bringing a symbol to a new run is brokenGuillaume Martres2017-01-282-5/+14
| | |
| * | Workaroud #1856: recursively calling a lazy val works differently in DottyGuillaume Martres2017-01-282-2/+21
| | |
| * | Fix bug in partest.DPConsoleRunnerGuillaume Martres2017-01-281-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug was that we declared case classes like: case class CompFailed() extends NegTestState but we used their companion objects like in: case _ => CompFailed Interestingly, this bug was caught by compiling this code with dotty, instead of `failureStates` getting inferred to be of type `AnyRef`, it ended up being a union of object types, this allows dotty to realize our subsequent pattern match on `failureStates` cannot possibly succeed: -- Error: /home/smarter/opt/dotty/compiler/test/dotty/partest/DPConsoleRunner.scala 353 | case CompFailedButWrongDiff() => | ^ | missing parameter type for parameter x$1 of expanded function x$1 => | x$1 @unchecked match | { | case CompFailedButWrongDiff() => | nextTestActionFailing(s"output differs") | true | case _ => | false | }, expected = ? -- Error: /home/smarter/opt/dotty/compiler/test/dotty/partest/DPConsoleRunner.scala 353 | case CompFailedButWrongDiff() => | ^^^^^^^^^^^^^^^^^^^^^^^^ |Pattern type CompFailedButWrongDiff is neither a subtype nor a supertype of selector type CompSucceeded | CompFailedButWrongNErr | CompFailed | CompFailedButWrongDiff'where: CompFailedButWrongDiff is a class in method runNegTest | CompFailedButWrongDiff' is a object in method runNegTest
| * | 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