We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c69eebd commit c972766Copy full SHA for c972766
compiler/src/dotty/tools/dotc/ast/Desugar.scala
@@ -256,10 +256,14 @@ object desugar {
256
evidenceParamBuf.toList)
257
end elimContextBounds
258
259
- //TODO: this is a hack. Typing causes problems (e.g. scaladoc)
260
def isPreciseAnnot(tree: untpd.Tree)(using Context): Boolean =
261
tree match
262
- case Apply(Select(New(Ident(precise)), _), _) => precise.toString == "precise"
+ case Apply(Select(New(clsSel), _), Nil) =>
+ inContext(ctx.fresh.setReporter(Reporter.NoReporter).setExploreTyperState()) {
263
+ try
264
+ ctx.typer.typedExpr(clsSel).tpe.classSymbol == defn.PreciseAnnot
265
+ catch case _ : Throwable => false
266
+ }
267
case _ => false
268
269
def addDefaultGetters(meth: DefDef)(using Context): Tree =
0 commit comments