При проверке макроса на scala2.11.12 возникают неустранимые ошибки проверки типов.
В связи с этим Ошибка компиляции подтверждается в момент доступа к типуSignature определенного символа при расширении макроса
symbolList.flatMap { x =>
try {
c.typecheck(
c.parse(
x.fullName.replaceAll("([\\w]+)\\$([\\w]+)", "$1#$2")
),
silent = true
).symbol match {
case _ => Some(x)
}
} catch {
case _ => None
}
}
[warn] !!! creating stub symbol to defer error: Symbol 'term org.junit' is missing from the classpath.
[warn] This symbol is required by 'class org.scalatest.junit.MyRunListener'.
[warn] Make sure that term junit is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.java.lang.Throwable
[warn] A full rebuild may help if 'MyRunListener.class' was compiled against an incompatible version of org.
[error] <macro>:1:1: Symbol 'term org.junit' is missing from the classpath.
[error] This symbol is required by 'class org.scalatest.junit.MyRunListener'.
[error] Make sure that term junit is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
[error] A full rebuild may help if 'MyRunListener.class' was compiled against an incompatible version of org.
[error] org.scalatest.junit.MyRunListener
[error] ^
Я хочу пропустить это исключение.Эта проверка типов, наконец, генерирует java.lang.Throwable, но он не может перехватить с помощью «try catch».
Эта ошибка возникает при
org.scalatest: 3.0.8
org.scalatestplus: 3.0.8
akka-stream: 2.5.23
Отображаемая трассировка стека отладки
java.lang.Throwable
at scala.reflect.internal.Symbols$StubSymbol$class.fail(Symbols.scala:3507)
at scala.reflect.internal.Symbols$StubSymbol$class.info(Symbols.scala:3518)
at scala.reflect.internal.Symbols$StubClassSymbol.info(Symbols.scala:3522)
at scala.reflect.internal.Symbols$StubClassSymbol.info(Symbols.scala:3522)
at scala.reflect.internal.pickling.UnPickler$Scan.scala$reflect$internal$pickling$UnPickler$Scan$$nestedObjectSymbol$1(UnPickler.scala:230)
at scala.reflect.internal.pickling.UnPickler$Scan.readExtSymbol$1(UnPickler.scala:258)
at scala.reflect.internal.pickling.UnPickler$Scan.readSymbol(UnPickler.scala:286)
at scala.reflect.internal.pickling.UnPickler$Scan.readSymbolRef(UnPickler.scala:651)
at scala.reflect.internal.pickling.UnPickler$Scan.readThisType$1(UnPickler.scala:400)
at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:415)
at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:660)
at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:660)
at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:179)
at scala.reflect.internal.pickling.UnPickler$Scan.readTypeRef(UnPickler.scala:660)
at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:419)
at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:660)
at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:660)
at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:179)
at scala.reflect.internal.pickling.UnPickler$Scan.readTypeRef(UnPickler.scala:660)
at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypes$1$1.apply(UnPickler.scala:379)
at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypes$1$1.apply(UnPickler.scala:379)
at scala.reflect.internal.pickling.PickleBuffer.until(PickleBuffer.scala:154)
at scala.reflect.internal.pickling.UnPickler$Scan.readTypes$1(UnPickler.scala:379)
at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:421)
at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef$$anonfun$7.apply(UnPickler.scala:734)
at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef$$anonfun$7.apply(UnPickler.scala:734)
at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:179)
at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.completeInternal(UnPickler.scala:734)
at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.complete(UnPickler.scala:761)
at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.load(UnPickler.scala:764)
at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.initRoot(SymbolLoaders.scala:239)
at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:224)
at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.load(SymbolLoaders.scala:227)
at scala.tools.nsc.typechecker.Typers$Typer.isStale(Typers.scala:496)
at scala.tools.nsc.typechecker.Typers$Typer.reallyExists(Typers.scala:487)
at scala.tools.nsc.typechecker.Typers$Typer.typedSelectInternal$1(Typers.scala:4745)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedSelect$1(Typers.scala:4709)
at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala:4848)
at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5371)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5387)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5423)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5450)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5397)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5401)
at scala.reflect.macros.contexts.Typers$$anonfun$typecheckInternal$1$1.apply(Typers.scala:27)
at scala.reflect.macros.contexts.Typers$$anonfun$typecheckInternal$1$1.apply(Typers.scala:27)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:680)
at scala.reflect.macros.contexts.Typers$class.typecheckInternal$1(Typers.scala:27)
at scala.reflect.macros.contexts.Typers$$anonfun$typecheck$2$$anonfun$apply$1.apply(Typers.scala:28)
at scala.reflect.macros.contexts.Typers$$anonfun$typecheck$2$$anonfun$apply$1.apply(Typers.scala:28)
at scala.reflect.macros.contexts.Typers$$anonfun$3.apply(Typers.scala:24)
at scala.reflect.macros.contexts.Typers$$anonfun$3.apply(Typers.scala:24)
at scala.reflect.macros.contexts.Typers$$anonfun$withContext$1$1.apply(Typers.scala:25)
at scala.reflect.macros.contexts.Typers$$anonfun$withContext$1$1.apply(Typers.scala:25)
at scala.reflect.macros.contexts.Typers$$anonfun$1.apply(Typers.scala:23)
at scala.reflect.macros.contexts.Typers$$anonfun$1.apply(Typers.scala:23)
at scala.reflect.macros.contexts.Typers$class.withContext$1(Typers.scala:25)
at scala.reflect.macros.contexts.Typers$$anonfun$typecheck$2.apply(Typers.scala:28)
at scala.reflect.macros.contexts.Typers$$anonfun$typecheck$2.apply(Typers.scala:28)
at scala.reflect.internal.Trees$class.wrappingIntoTerm(Trees.scala:1716)
at scala.reflect.internal.SymbolTable.wrappingIntoTerm(SymbolTable.scala:16)
at scala.reflect.macros.contexts.Typers$class.withWrapping$1(Typers.scala:26)
at scala.reflect.macros.contexts.Typers$class.typecheck(Typers.scala:28)
at scala.reflect.macros.contexts.Context.typecheck(Context.scala:6)
at scala.reflect.macros.contexts.Context.typecheck(Context.scala:6)
at com.phylage.scaladia.internal.AutoDIExtractor$RichVectorSymbol$$anonfun$accessible$1.apply(AutoDIExtractor.scala:137)
at com.phylage.scaladia.internal.AutoDIExtractor$RichVectorSymbol$$anonfun$accessible$1.apply(AutoDIExtractor.scala:133)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
at scala.collection.Iterator$class.foreach(Iterator.scala:891)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1334)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:241)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:104)
at com.phylage.scaladia.internal.AutoDIExtractor$RichVectorSymbol.accessible(AutoDIExtractor.scala:133)
at com.phylage.scaladia.internal.AutoDIExtractor.recursiveModuleExplore(AutoDIExtractor.scala:120)
at com.phylage.scaladia.internal.AutoDIExtractor.recursivePackageExplore(AutoDIExtractor.scala:112)
at com.phylage.scaladia.internal.AutoDIExtractor.run(AutoDIExtractor.scala:80)
at com.phylage.scaladia.internal.AutoDIExtractor$.getList(AutoDIExtractor.scala:16)
at com.phylage.scaladia.internal.Macro$.lazyInject(Macro.scala:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at scala.reflect.macros.runtime.JavaReflectionRuntimes$JavaReflectionResolvers$$anonfun$resolveJavaReflectionRuntime$2.apply(JavaReflectionRuntimes.scala:34)
at scala.reflect.macros.runtime.JavaReflectionRuntimes$JavaReflectionResolvers$$anonfun$resolveJavaReflectionRuntime$2.apply(JavaReflectionRuntimes.scala:22)
at scala.tools.nsc.typechecker.Macros$class.macroExpandWithRuntime(Macros.scala:763)
at scala.tools.nsc.Global$$anon$1.macroExpandWithRuntime(Global.scala:489)
at scala.tools.nsc.typechecker.Macros$MacroExpander$$anonfun$expand$1.apply(Macros.scala:580)
at scala.tools.nsc.typechecker.Macros$MacroExpander$$anonfun$expand$1.apply(Macros.scala:573)
at scala.tools.nsc.Global.withInfoLevel(Global.scala:225)
at scala.tools.nsc.typechecker.Macros$MacroExpander.expand(Macros.scala:572)
at scala.tools.nsc.typechecker.Macros$MacroExpander.apply(Macros.scala:560)
at scala.tools.nsc.typechecker.Macros$class.standardMacroExpand(Macros.scala:724)
at scala.tools.nsc.Global$$anon$1.standardMacroExpand(Global.scala:489)
at scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$10.default(AnalyzerPlugins.scala:400)
at scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$10.default(AnalyzerPlugins.scala:397)
at scala.tools.nsc.typechecker.AnalyzerPlugins$class.invoke(AnalyzerPlugins.scala:369)
at scala.tools.nsc.typechecker.AnalyzerPlugins$class.pluginsMacroExpand(AnalyzerPlugins.scala:397)
at scala.tools.nsc.Global$$anon$1.pluginsMacroExpand(Global.scala:489)
at scala.tools.nsc.typechecker.Macros$class.macroExpand(Macros.scala:717)
at scala.tools.nsc.Global$$anon$1.macroExpand(Global.scala:489)
at scala.tools.nsc.typechecker.Typers$Typer.vanillaAdapt$1(Typers.scala:1111)
at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1166)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5437)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5450)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5397)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5401)
at scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:823)
at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1162)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5437)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5450)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5397)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5401)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5492)
at scala.tools.nsc.typechecker.Typers$Typer.computeType(Typers.scala:5583)
at scala.tools.nsc.typechecker.Namers$Namer.assignTypeToTree(Namers.scala:967)
at scala.tools.nsc.typechecker.Namers$Namer.methodSig(Namers.scala:1322)
at scala.tools.nsc.typechecker.Namers$Namer.getSig$1(Namers.scala:1638)
at scala.tools.nsc.typechecker.Namers$Namer.typeSig(Namers.scala:1650)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply$mcV$sp(Namers.scala:869)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:868)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:868)
at scala.tools.nsc.typechecker.Namers$Namer.scala$tools$nsc$typechecker$Namers$Namer$$logAndValidate(Namers.scala:1677)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:868)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:860)
at scala.tools.nsc.typechecker.Namers$$anon$1.completeImpl(Namers.scala:1799)
at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter$class.complete(Namers.scala:1807)
at scala.tools.nsc.typechecker.Namers$$anon$1.complete(Namers.scala:1797)
at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1535)
at scala.reflect.internal.Symbols$Symbol.initialize(Symbols.scala:1680)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5035)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5423)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5450)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5397)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5401)
at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5481)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:3042)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3150)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3150)
at scala.collection.immutable.List.loop$1(List.scala:176)
at scala.collection.immutable.List.mapConserve(List.scala:200)
at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3150)
at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1916)
at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1757)
at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5336)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5386)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5423)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5450)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5397)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5401)
at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5481)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:3042)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3150)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3150)
at scala.collection.immutable.List.loop$1(List.scala:176)
at scala.collection.immutable.List.mapConserve(List.scala:200)
at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3150)
at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1916)
at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1803)
at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5337)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5386)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5423)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5450)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5397)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5401)
at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5481)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:3042)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3150)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3150)
at scala.collection.immutable.List.loop$1(List.scala:176)
at scala.collection.immutable.List.mapConserve(List.scala:200)
at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3150)
at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1916)
at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1803)
at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5337)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5386)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5423)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5450)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5397)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5401)
at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5481)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:3042)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3150)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3150)
at scala.collection.immutable.List.loop$1(List.scala:176)
at scala.collection.immutable.List.mapConserve(List.scala:200)
at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3150)
at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5042)
at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5339)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5386)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5423)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5450)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5397)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5401)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5477)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:102)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:467)
at scala.tools.nsc.Global$GlobalPhase.withCurrentUnit(Global.scala:458)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:467)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:94)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:93)
at scala.collection.Iterator$class.foreach(Iterator.scala:891)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1334)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1528)
at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1513)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:1508)
at scala.tools.nsc.Global$Run.compile(Global.scala:1609)
at xsbt.CachedCompiler0.run(CompilerInterface.scala:130)
at xsbt.CachedCompiler0.run(CompilerInterface.scala:105)
at xsbt.CompilerInterface.run(CompilerInterface.scala:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:237)
at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:111)
at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:90)
at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:82)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:133)
at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:73)
at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:116)
at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:307)
at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:307)
at sbt.internal.inc.Incremental$.doCompile(Incremental.scala:106)
at sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:87)
at sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:116)
at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:63)
at sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:89)
at sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:134)
at sbt.internal.inc.Incremental$.compile(Incremental.scala:80)
at sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:67)
at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:311)
at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:269)
at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:159)
at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:238)
at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:69)
at sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:1549)
at sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:1523)
at scala.Function1.$anonfun$compose$1(Function1.scala:44)
at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:67)
at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
at sbt.Execute.work(Execute.scala:278)
at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Как воспроизвести
Настройка для build.sbt
scalacOptions += "-Ydebug",
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.8",
scalaVersion := "2.11.12"
Реализация макроса
def xxx: Any = macro Macro.exec
def exec(c: blackbox.Context): c.Tree = {
import c.universe._
c.typecheck(
c.parse(
"org.scalatest.junit.MyRunListener"
),
silent = true
)
}
Затем в функции проверки типов возникает неисправимая ошибка.Я хочу игнорировать это.