diff options
Diffstat (limited to 'src/dotty/tools/dotc/core/Comments.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Comments.scala | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/dotty/tools/dotc/core/Comments.scala b/src/dotty/tools/dotc/core/Comments.scala index 0a57d331a..1d9d53bac 100644 --- a/src/dotty/tools/dotc/core/Comments.scala +++ b/src/dotty/tools/dotc/core/Comments.scala @@ -60,6 +60,9 @@ object Comments { /** Entered by Namer */ var symbol: Symbol = _ + /** Set by typer */ + var tpdCode: tpd.DefDef = _ + lazy val untpdCode: untpd.Tree = { val tree = new Parser(new SourceFile("<usecase>", code)).localDef(codePos.start, EmptyFlags) @@ -72,19 +75,5 @@ object Comments { tree } } - - /** Set by typer calling `typeTree` */ - var tpdCode: tpd.DefDef = _ - - def typeTree()(implicit ctx: Context): Unit = untpdCode match { - case df: untpd.DefDef => - ctx.typer.typedDefDef(df, symbol) match { - case tree: tpd.DefDef => tpdCode = tree - case _ => - ctx.error("proper def could not be typed from `@usecase`", codePos) - } - case _ => - ctx.error("proper def was not found in `@usecase`", codePos) - } } } |