Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoDenotation.owner while compiling code with coverage #17605

Closed
susuro opened this issue May 27, 2023 · 2 comments
Closed

NoDenotation.owner while compiling code with coverage #17605

susuro opened this issue May 27, 2023 · 2 comments
Labels
area:coverage Code coverage, see https://dotty.epfl.ch/docs/internals/coverage.html itype:crash

Comments

@susuro
Copy link

susuro commented May 27, 2023

Compiler version

3.3.0

Minimized code

import java.util.Locale
class BooleanFormatter(tt: String, ft: String, locale: Locale):
  def this(tt: String, ft: String) = this(tt, ft, Locale.getDefault)

Compile command:

scalac -coverage-out:coverage BooleanFormatter.scala

Output (click arrow to expand)

java.lang.AssertionError: NoDenotation.owner while running MegaPhase{crossVersionChecks, protectedAccessors, extmethods, uncacheGivenAliases, elimByName, hoistSuperArgs, forwardDepChecks, specializeApplyMethods, tryCatchPatterns, patternMatcher} on BooleanFormatter.scala
exception occurred while compiling BooleanFormatter.scala
java.lang.AssertionError: NoDenotation.owner while compiling BooleanFormatter.scala
Exception in thread "main" java.lang.AssertionError: NoDenotation.owner
	at dotty.tools.dotc.core.SymDenotations$NoDenotation$.owner(SymDenotations.scala:2576)
	at dotty.tools.dotc.transform.HoistSuperArgs$Hoister.hoistSuperArgsFromCall(HoistSuperArgs.scala:185)
	at dotty.tools.dotc.transform.HoistSuperArgs$Hoister.hoistSuperArgsFromConstr(HoistSuperArgs.scala:218)
	at dotty.tools.dotc.transform.HoistSuperArgs.$anonfun$7(HoistSuperArgs.scala:230)
	at dotty.tools.dotc.core.Decorators$.loop$1(Decorators.scala:94)
	at dotty.tools.dotc.core.Decorators$.mapconserve(Decorators.scala:110)
	at dotty.tools.dotc.transform.HoistSuperArgs.transformTypeDef(HoistSuperArgs.scala:230)
	at dotty.tools.dotc.transform.MegaPhase.goTypeDef(MegaPhase.scala:995)
	at dotty.tools.dotc.transform.MegaPhase.goTypeDef(MegaPhase.scala:996)
	at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:256)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:425)
	at dotty.tools.dotc.transform.MegaPhase.loop$1(MegaPhase.scala:438)
	at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:438)
	at dotty.tools.dotc.transform.MegaPhase.mapPackage$1(MegaPhase.scala:379)
	at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:382)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
	at dotty.tools.dotc.transform.MegaPhase.transformUnit(MegaPhase.scala:454)
	at dotty.tools.dotc.transform.MegaPhase.run(MegaPhase.scala:466)
	at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:324)
	at scala.collection.immutable.List.map(List.scala:246)
	at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:328)
	at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:247)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1321)
	at dotty.tools.dotc.Run.runPhases$1(Run.scala:263)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:271)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:280)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:280)
	at dotty.tools.dotc.Run.compileSources(Run.scala:195)
	at dotty.tools.dotc.Run.compile(Run.scala:179)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:35)
	at dotty.tools.dotc.Driver.process(Driver.scala:195)
	at dotty.tools.dotc.Driver.process(Driver.scala:163)
	at dotty.tools.dotc.Driver.process(Driver.scala:175)
	at dotty.tools.dotc.Driver.main(Driver.scala:205)
	at dotty.tools.MainGenericCompiler$.run$1(MainGenericCompiler.scala:162)
	at dotty.tools.MainGenericCompiler$.main(MainGenericCompiler.scala:186)
	at dotty.tools.MainGenericCompiler.main(MainGenericCompiler.scala)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at coursier.bootstrap.launcher.a.a(Unknown Source)
	at coursier.bootstrap.launcher.Launcher.main(Unknown Source)

Additional info

The code compiles without the coverage compile option.
The same error is reported while using sbt-scoverage plugin instead of the compile option.
This is very similar to issue #17042.

@susuro susuro added itype:bug itype:crash stat:needs triage Every issue needs to have an "area" and "itype" label labels May 27, 2023
@szymon-rd szymon-rd added area:coverage Code coverage, see https://dotty.epfl.ch/docs/internals/coverage.html and removed itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels May 29, 2023
@jxnu-liguobin
Copy link
Member

+1

@KacperFKorban
Copy link
Member

Already fixed in 3.3.1-RC1 - 3.3.1-RC6

@KacperFKorban KacperFKorban closed this as not planned Won't fix, can't repro, duplicate, stale Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:coverage Code coverage, see https://dotty.epfl.ch/docs/internals/coverage.html itype:crash
Projects
None yet
Development

No branches or pull requests

4 participants