File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -256,10 +256,14 @@ object desugar {
256
256
evidenceParamBuf.toList)
257
257
end elimContextBounds
258
258
259
- // TODO: this is a hack. Typing causes problems (e.g. scaladoc)
260
259
def isPreciseAnnot (tree : untpd.Tree )(using Context ): Boolean =
261
260
tree match
262
- case Apply (Select (New (Ident (precise)), _), _) => precise.toString == " precise"
261
+ case Apply (Select (New (clsSel), _), Nil ) =>
262
+ inContext(ctx.fresh.setReporter(Reporter .NoReporter ).setExploreTyperState()) {
263
+ try
264
+ ctx.typer.typedExpr(clsSel).tpe.classSymbol == defn.PreciseAnnot
265
+ catch case _ : Throwable => false
266
+ }
263
267
case _ => false
264
268
265
269
def addDefaultGetters (meth : DefDef )(using Context ): Tree =
You can’t perform that action at this time.
0 commit comments