aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/ast/tpd.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-12-22 18:34:00 +0100
committerMartin Odersky <odersky@gmail.com>2013-12-22 18:58:18 +0100
commit6ed666c4be5bc4904c926a265d711b85f729d4b3 (patch)
treebfd51f640ecd89eb3a6d111213747af77c68dde2 /src/dotty/tools/dotc/ast/tpd.scala
parent108be8880688653de490975f29f6ae469e9f3e6a (diff)
downloaddotty-6ed666c4be5bc4904c926a265d711b85f729d4b3.tar.gz
dotty-6ed666c4be5bc4904c926a265d711b85f729d4b3.tar.bz2
dotty-6ed666c4be5bc4904c926a265d711b85f729d4b3.zip
Typing by-name parameters with ExprTypes.
To avoid duplication between by-name parameters and expr types, we treat by-name parameters as as having ExprType. A part of this is introducing ByNameTypeTree, a specific tree class for => T types.
Diffstat (limited to 'src/dotty/tools/dotc/ast/tpd.scala')
-rw-r--r--src/dotty/tools/dotc/ast/tpd.scala3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/ast/tpd.scala b/src/dotty/tools/dotc/ast/tpd.scala
index 8d079fa72..3e2b0d7f9 100644
--- a/src/dotty/tools/dotc/ast/tpd.scala
+++ b/src/dotty/tools/dotc/ast/tpd.scala
@@ -196,6 +196,9 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
def AppliedTypeTree(tpt: Tree, args: List[Tree])(implicit ctx: Context): AppliedTypeTree =
untpd.AppliedTypeTree(tpt, args).withType(tpt.tpe.appliedTo(args map (_.tpe))).checked
+ def ByNameTypeTree(result: Tree)(implicit ctx: Context): ByNameTypeTree =
+ untpd.ByNameTypeTree(result).withType(ExprType(result.tpe)).checked
+
def TypeBoundsTree(lo: Tree, hi: Tree)(implicit ctx: Context): TypeBoundsTree =
untpd.TypeBoundsTree(lo, hi).withType(TypeBounds(lo.tpe, hi.tpe)).checked