Skip to content

Commit 7e53968

Browse files
committed
Merge remote-tracking branch 'dotty/master' into call-graph-wip-1
2 parents c4bafda + 7b1cdbc commit 7e53968

File tree

12 files changed

+70
-17
lines changed

12 files changed

+70
-17
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ Dotty
88
* [FAQ](http://dotty.epfl.ch/#why-dotty)
99
* [Mailing list](https://groups.google.com/forum/#!forum/dotty-internals)
1010

11+
Try it out
12+
==========
13+
To try it in your project see also the [Getting Started User Guide](http://dotty.epfl.ch/#getting-started).
14+
1115
How to Contribute
1216
=================
13-
* [Getting Started](http://dotty.epfl.ch/docs/contributing/getting-started.html)
17+
* [Getting Started as Contributor](http://dotty.epfl.ch/docs/contributing/getting-started.html)
1418
* [Awesome Error Messages](http://scala-lang.org/blog/2016/10/14/dotty-errors.html)
1519
* [Issues](https://github.com/lampepfl/dotty/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
1620

collection-strawman

Submodule collection-strawman updated 68 files

compiler/src/dotty/tools/dotc/core/Annotations.scala

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,15 @@ object Annotations {
141141
apply(defn.AliasAnnot, List(
142142
ref(TermRef.withSigAndDenot(sym.owner.thisType, sym.name, sym.signature, sym))))
143143

144-
def makeChild(sym: Symbol)(implicit ctx: Context) =
145-
deferred(defn.ChildAnnot,
146-
implicit ctx => New(defn.ChildAnnotType.appliedTo(sym.owner.thisType.select(sym.name, sym)), Nil))
144+
def makeChild(delayedSym: Context => Symbol)(implicit ctx: Context): Annotation = {
145+
def makeChildLater(implicit ctx: Context) = {
146+
val sym = delayedSym(ctx)
147+
New(defn.ChildAnnotType.appliedTo(sym.owner.thisType.select(sym.name, sym)), Nil)
148+
}
149+
deferred(defn.ChildAnnot, implicit ctx => makeChildLater(ctx))
150+
}
151+
152+
def makeChild(sym: Symbol)(implicit ctx: Context): Annotation = makeChild(_ => sym)
147153

148154
def makeSourceFile(path: String)(implicit ctx: Context) =
149155
apply(defn.SourceFileAnnot, Literal(Constant(path)))

compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,8 +829,13 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
829829
assert(tag == CHILDREN)
830830
val end = readNat() + readIndex
831831
val target = readSymbolRef()
832-
while (readIndex != end)
833-
target.addAnnotation(Annotation.makeChild(readSymbolRef()))
832+
while (readIndex != end) {
833+
val start = readIndex
834+
readNat() // skip reference for now
835+
target.addAnnotation(
836+
Annotation.makeChild(implicit ctx =>
837+
atReadPos(start, () => readSymbolRef())))
838+
}
834839
}
835840

836841
/* Read a reference to a pickled item */

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,12 @@ class CompilationTests extends ParallelTesting {
305305

306306
def idempotency1() = {
307307
compileList("dotty1", compilerSources ++ backendSources ++ backendJvmSources, opt) +
308+
compileDir("../collection-strawman/src/main", opt) +
308309
compileFilesInDir("../tests/pos", opt)
309310
}
310311
def idempotency2() = {
311312
compileList("dotty1", compilerSources ++ backendSources ++ backendJvmSources, opt) +
313+
compileDir("../collection-strawman/src/main", opt) +
312314
compileFilesInDir("../tests/pos", opt)
313315
}
314316

docs/_includes/getting-started.html

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1-
<div class="page white">
2-
<div class="centered" style="padding-top: 32px">
3-
<h1 id="getting-started">Getting Started</h1>
4-
<p>
5-
See the <a href="https://github.com/lampepfl/dotty-example-project">example project</a>.
6-
</p>
1+
<div class="page blue">
2+
<div class="centered questions">
3+
4+
<h1 id="getting-started">Try Dotty</h1>
5+
<p>Try it in your browser with <a href="https://scastie.scala-lang.org/">Scastie</a> by changing the target to Dotty in the Build Settings.</p>
6+
7+
8+
<h1 id="getting-started-with-a-project">Create a Dotty Project</h1>
9+
<p>The fastest way to create a new project in Dotty is using <a href="http://www.scala-sbt.org/">sbt (0.13.15+)</a>.</p>
10+
11+
<p>Create a Dotty project:</p>
12+
<pre class="sourceCode bright"><code>sbt new <a href="https://github.com/lampepfl/dotty.g8">lampepfl/dotty.g8</a></code></pre>
13+
14+
<p>Or a Dotty project that cross compiles with Scala 2:</p>
15+
<pre class="sourceCode bright"><code>sbt new <a href="https://github.com/lampepfl/dotty-cross.g8">lampepfl/dotty-cross.g8</a></code></pre>
16+
17+
<p>For documentation see the <a href="https://github.com/lampepfl/dotty-example-project">Dotty Example Project</a>.</p>
18+
719
</div>
820
</div>
9-

docs/_includes/logo-page.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<div class="page red exactly-one-page">
22
<div id="header">
33
<nav class="nav nav-pills">
4+
<li class="nav-item">
5+
<a class="nav-link" href="#getting-started">
6+
Try it now
7+
</a>
8+
</li>
49
<li class="nav-item">
510
<a class="nav-link" href="#why-dotty">
611
FAQ

docs/docs/usage/sbt-projects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ layout: doc-page
33
title: "Using Dotty with sbt"
44
---
55

6-
See the [example project](https://github.com/lampepfl/dotty-example-project).
6+
To try it in your project see the [Getting Started User Guide](http://dotty.epfl.ch/#getting-started).

docs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
---
1313
<div id="content">
1414
{% include logo-page.html %}
15-
{% include faq.html %}
16-
{% include features.html %}
1715
{% include getting-started.html %}
16+
{% include features.html %}
17+
{% include faq.html %}
1818
</div>

tests/new/projection.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class C { type T }
2+
object test {
3+
def x: C#T = ???
4+
}

tests/pos/i2391/Containers.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Containers.scala
2+
package foo
3+
4+
trait ParentContainer {
5+
sealed trait Entry
6+
}
7+
8+
class ChildContainer extends ParentContainer {
9+
trait LazyEntry extends Entry
10+
}

tests/pos/i2391/User.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// User.scala
2+
package foo
3+
4+
trait User {
5+
type Entry <: ChildContainer#Entry
6+
}

0 commit comments

Comments
 (0)