File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,7 @@ import Decorators._
1919
2020object Trees {
2121
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
2923
3024 /** The total number of created tree nodes, maintained if Stats.enabled */
3125 @ sharable var ntrees : Int = 0
@@ -44,8 +38,7 @@ object Trees {
4438 *
4539 * - You can never observe a `tpe` which is `null` (throws an exception)
4640 * - 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.
4942 * - It is impossible to embed untyped trees in typed ones.
5043 * - Typed trees can be embedded in untyped ones provided they are rooted
5144 * in a TypedSplice node.
You can’t perform that action at this time.
0 commit comments