Skip to content

assertion failed: bad parameter reference this.A at tryCatchPatterns #3863

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

Closed
julienrf opened this issue Jan 18, 2018 · 2 comments
Closed

assertion failed: bad parameter reference this.A at tryCatchPatterns #3863

julienrf opened this issue Jan 18, 2018 · 2 comments

Comments

@julienrf
Copy link
Contributor

When compiling the following code:

https://github.com/msteindorfer/collection-strawman/blob/681ca06be902c6f901fd74a1aaa7d2c87fb2d9a5/collections/src/main/scala/strawman/collection/immutable/ChampHashSet.scala#L564-L578

We get the following error:

java.lang.AssertionError: assertion failed: bad parameter reference this.A at tryCatchPatterns
the parameter is type A in class SetKeyIterator but the prefix strawman.collection.immutable.SetKeyIterator(this)
does not define any corresponding arguments.
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:39)
	at dotty.tools.dotc.core.Types$NamedType.argDenot(Types.scala:1747)
	at dotty.tools.dotc.core.Types$NamedType.fromDesignator$1(Types.scala:1675)
	at dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:1696)
	at dotty.tools.dotc.core.Types$NamedType.denotAt(Types.scala:1647)
	at dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:1636)
	at dotty.tools.dotc.core.Types$NamedType.info(Types.scala:1630)
	at dotty.tools.dotc.core.TypeComparer.secondTry(TypeComparer.scala:282)
	at dotty.tools.dotc.core.TypeComparer.firstTry(TypeComparer.scala:277)
	at dotty.tools.dotc.core.TypeComparer.op$7(TypeComparer.scala:118)
	at dotty.tools.dotc.core.TypeComparer.op$1(TypeComparer.scala:32)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:109)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen(ConstraintHandling.scala:161)
	at dotty.tools.dotc.core.Types$Type.op$17(Types.scala:771)
	at dotty.tools.dotc.core.Types$Type.frozen_$less$colon$less(Types.scala:770)
	at dotty.tools.dotc.core.Types$Type.overrides(Types.scala:807)
	at dotty.tools.dotc.typer.RefChecks$.compatibleTypes$4(RefChecks.scala:272)
	at dotty.tools.dotc.typer.RefChecks$.checkOverride$1(RefChecks.scala:380)
	at dotty.tools.dotc.typer.RefChecks$.dotty$tools$dotc$typer$RefChecks$$$checkAllOverrides(RefChecks.scala:401)
	at dotty.tools.dotc.typer.RefChecks.transformTemplate(RefChecks.scala:846)
	at dotty.tools.dotc.transform.MegaPhase.goTemplate(MegaPhase.scala:906)

See the full stack-trace here https://travis-ci.org/scala/collection-strawman/builds/330072462#L1269

@allanrenucci
Copy link
Contributor

I believe it is a duplicate of #3775. @julienrf Can you try rewriting def next as def next() and let me know if this fixes the issue.

msteindorfer added a commit to msteindorfer/collection-strawman that referenced this issue Jan 18, 2018
@julienrf
Copy link
Contributor Author

Indeed @allanrenucci, writing next() solved our issue, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants