| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Fix #1568 - avoid transforming error trees
|
| |
| |
| |
| |
| | |
If a tree has type error, subtrees may not have an assigned type.
Therefore we should avoid transforming such trees.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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$`.
|
|\ \
| | |
| | | |
[doctool] Add markdown support && Static site generation
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
fix #1626: inconsistent names in prettyprint
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Fix #1569: Fix logic for by-name parameters of inline methods
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
avoid using macro-based StringContext.f to ease bootstrap
|
| | |/ / /
| |/| | | |
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
support pre-typer transform of trees
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
Fix-#1723: Avoid private leaks on completion
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
avoidPrivateLeaks got moved from Checking to TypeAssigner, where it
fits well besides the other avoid methods.
|
| | | | |
| | | | |
| | | | |
| | | | | |
As #1723 demonstrates, doing this at PostTyper is too late.
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
Fix #1644: Disallow inner classes in value classes
|
| | | | | |
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
Fix #1915 Synthetic function traits need NoInits flag
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
It was used only once and its body is almost as short as the name,
so no need to have a separate method.
|
| | |/ /
| |/| |
| | | |
| | | | |
Fixes #1915.
|
|\ \ \ \
| | | | |
| | | | | |
Implement structural type member access
|
| | | | |
| | | | |
| | | | |
| | | | | |
We can't handle them with the proposed scheme. I made a note in #1886.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Use base types instead of implicits. This is more robust
in the presence of type abstraction.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
New scheme for implementing structural type member access.
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
Fix incorrect flatten of thicket inside interpolated string in UntpdTreeMap
|
| | |_|/
| |/| | |
|
| |_|/
|/| |
| | |
| | |
| | | |
xxl closures need to get the SAM type FunctionXXL as their explicit
type field after ersure.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
Add sbt-based bootstrap
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | | |
Using changeOwnerAfter would be more appropriate but currently fails
with an assertion in LambdaLift
|