File tree 1 file changed +2
-9
lines changed
compiler/src/dotty/tools/dotc/ast 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,7 @@ import Decorators._
19
19
20
20
object Trees {
21
21
22
- // Note: it would be more logical to make Untyped = Nothing.
23
- // However, this interacts in a bad way with Scala's current type inference.
24
- // In fact, we cannot write something like Select(pre, name), where pre is
25
- // of type Tree[Nothing]; type inference will treat the Nothing as an uninstantiated
26
- // value and will not infer Nothing as the type parameter for Select.
27
- // We should come back to this issue once type inference is changed.
28
- type Untyped = Null
22
+ type Untyped = Nothing
29
23
30
24
/** The total number of created tree nodes, maintained if Stats.enabled */
31
25
@ sharable var ntrees : Int = 0
@@ -44,8 +38,7 @@ object Trees {
44
38
*
45
39
* - You can never observe a `tpe` which is `null` (throws an exception)
46
40
* - So when creating a typed tree with `withType` we can re-use
47
- * the existing tree transparently, assigning its `tpe` field,
48
- * provided it was `null` before.
41
+ * the existing tree transparently, assigning its `tpe` field.
49
42
* - It is impossible to embed untyped trees in typed ones.
50
43
* - Typed trees can be embedded in untyped ones provided they are rooted
51
44
* in a TypedSplice node.
You can’t perform that action at this time.
0 commit comments