Skip to content

:type crash REPL #6643

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
newca12 opened this issue Jun 8, 2019 · 3 comments
Closed

:type crash REPL #6643

newca12 opened this issue Jun 8, 2019 · 3 comments

Comments

@newca12
Copy link
Contributor

newca12 commented Jun 8, 2019

scala> import scala.collection._
scala> object IterableTest { def g[CC[_] <: Iterable[_] with IterableOps[_, _, _]](from: CC[Int]): IterableFactory[CC] = ??? }

give expected error but preceding with :type something crash the REPL

scala> :type 1
Int

scala> object IterableTest { def g[CC[_] <: Iterable[_] with IterableOps[_, _, _]](from: CC[Int]): IterableFactory[CC] = ??? }
Exception in thread "main" java.lang.AssertionError: assertion failed: denotation module class scala invalid in run 1. ValidFor: Period(1..2, run = 2)
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:16)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.updateValidity(Denotations.scala:817)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.bringForward(Denotations.scala:844)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:899)
	at dotty.tools.dotc.core.Symbols$Symbol.recomputeDenot(Symbols.scala:486)
	at dotty.tools.dotc.core.Symbols$Symbol.computeDenot(Symbols.scala:481)
	at dotty.tools.dotc.core.Symbols$Symbol.denot(Symbols.scala:475)
	at dotty.tools.dotc.core.Symbols$.toDenot(Symbols.scala:827)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.typeRef(SymDenotations.scala:1270)
	at dotty.tools.dotc.ast.untpd$.makeAndType(untpd.scala:429)
	at dotty.tools.dotc.parsing.Parsers$Parser.withTypeRest(Parsers.scala:1009)
	at dotty.tools.dotc.parsing.Parsers$Parser.withType(Parsers.scala:1002)
	at dotty.tools.dotc.parsing.Parsers$Parser.$init$$$anonfun$2(Parsers.scala:992)
	at dotty.tools.dotc.parsing.Parsers$Parser.infixType(Parsers.scala:981)
	at dotty.tools.dotc.parsing.Parsers$Parser.typ(Parsers.scala:955)
	at dotty.tools.dotc.parsing.Parsers$Parser.toplevelTyp(Parsers.scala:862)
	at dotty.tools.dotc.parsing.Parsers$Parser.bound(Parsers.scala:1189)
	at dotty.tools.dotc.parsing.Parsers$Parser.typeBounds(Parsers.scala:1186)
	at dotty.tools.dotc.parsing.Parsers$Parser.typeParamBounds(Parsers.scala:1195)
	at dotty.tools.dotc.parsing.Parsers$Parser.typeParam$1(Parsers.scala:2188)
	at dotty.tools.dotc.parsing.Parsers$Parser.typeParamClause$$anonfun$2$$anonfun$1(Parsers.scala:2192)
	at dotty.tools.dotc.parsing.Parsers$Parser.tokenSeparated(Parsers.scala:523)
	at dotty.tools.dotc.parsing.Parsers$Parser.commaSeparated(Parsers.scala:531)
	at dotty.tools.dotc.parsing.Parsers$Parser.typeParamClause$$anonfun$1(Parsers.scala:2192)
	at dotty.tools.dotc.parsing.Parsers$Parser.enclosed(Parsers.scala:503)
	at dotty.tools.dotc.parsing.Parsers$Parser.inBrackets(Parsers.scala:512)
	at dotty.tools.dotc.parsing.Parsers$Parser.typeParamClause(Parsers.scala:2193)
	at dotty.tools.dotc.parsing.Parsers$Parser.typeParamClauseOpt(Parsers.scala:2196)
	at dotty.tools.dotc.parsing.Parsers$Parser.defDefOrDcl(Parsers.scala:2567)
	at dotty.tools.dotc.parsing.Parsers$Parser.defOrDcl(Parsers.scala:2474)
	at dotty.tools.dotc.parsing.Parsers$Parser.templateStatSeq$$anonfun$1(Parsers.scala:3040)
	at dotty.tools.dotc.parsing.Parsers$Parser.checkNoEscapingPlaceholders(Parsers.scala:444)
	at dotty.tools.dotc.parsing.Parsers$Parser.templateStatSeq(Parsers.scala:3048)
	at dotty.tools.dotc.parsing.Parsers$Parser.$anonfun$26(Parsers.scala:2938)
	at dotty.tools.dotc.parsing.Parsers$Parser.enclosed(Parsers.scala:503)
	at dotty.tools.dotc.parsing.Parsers$Parser.inBraces(Parsers.scala:511)
	at dotty.tools.dotc.parsing.Parsers$Parser.inDefScopeBraces(Parsers.scala:516)
	at dotty.tools.dotc.parsing.Parsers$Parser.templateBody(Parsers.scala:2938)
	at dotty.tools.dotc.parsing.Parsers$Parser.templateBodyOpt(Parsers.scala:2933)
	at dotty.tools.dotc.parsing.Parsers$Parser.template(Parsers.scala:2916)
	at dotty.tools.dotc.parsing.Parsers$Parser.templateOpt(Parsers.scala:2924)
	at dotty.tools.dotc.parsing.Parsers$Parser.objectDefRest(Parsers.scala:2740)
	at dotty.tools.dotc.parsing.Parsers$Parser.objectDef(Parsers.scala:2736)
	at dotty.tools.dotc.parsing.Parsers$Parser.tmplDef(Parsers.scala:2694)
	at dotty.tools.dotc.parsing.Parsers$Parser.defOrDcl(Parsers.scala:2480)
	at dotty.tools.dotc.parsing.Parsers$Parser.localDef(Parsers.scala:3091)
	at dotty.tools.dotc.parsing.Parsers$Parser.blockStatSeq$$anonfun$1(Parsers.scala:3124)
	at dotty.tools.dotc.parsing.Parsers$Parser.checkNoEscapingPlaceholders(Parsers.scala:444)
	at dotty.tools.dotc.parsing.Parsers$Parser.blockStatSeq(Parsers.scala:3133)
	at dotty.tools.dotc.printing.SyntaxHighlighting$.highlight(SyntaxHighlighting.scala:121)
	at dotty.tools.repl.JLineTerminal$Highlighter.highlight(JLineTerminal.scala:76)
	at org.jline.reader.impl.LineReaderImpl.getHighlightedBuffer(LineReaderImpl.java:3633)
	at org.jline.reader.impl.LineReaderImpl.getDisplayedBufferWithPrompts(LineReaderImpl.java:3615)
	at org.jline.reader.impl.LineReaderImpl.redisplay(LineReaderImpl.java:3554)
	at org.jline.reader.impl.LineReaderImpl.redisplay(LineReaderImpl.java:3493)
	at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:611)
	at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:404)
	at dotty.tools.repl.JLineTerminal.readLine(JLineTerminal.scala:68)
	at dotty.tools.repl.ReplDriver.readLine$1(ReplDriver.scala:115)
	at dotty.tools.repl.ReplDriver.loop$1(ReplDriver.scala:125)
	at dotty.tools.repl.ReplDriver.runUntilQuit$$anonfun$1(ReplDriver.scala:130)
	at dotty.tools.repl.ReplDriver.withRedirectedOutput$$anonfun$2$$anonfun$1(ReplDriver.scala:143)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
	at scala.Console$.withErr(Console.scala:196)
	at dotty.tools.repl.ReplDriver.withRedirectedOutput$$anonfun$1(ReplDriver.scala:143)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
	at scala.Console$.withOut(Console.scala:167)
	at dotty.tools.repl.ReplDriver.withRedirectedOutput(ReplDriver.scala:143)
	at dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:130)
	at dotty.tools.repl.Main$.main(Main.scala:6)
	at dotty.tools.repl.Main.main(Main.scala)
@bishabosha
Copy link
Member

bishabosha commented Apr 6, 2020

This is fixed in master, or at least works with new collections

@nicolasstucki
Copy link
Contributor

@bishabosha do we have a test for this? If not reopen the issue an close it by adding a regression test.

@bishabosha bishabosha reopened this Apr 6, 2020
@bishabosha
Copy link
Member

@nicolasstucki I've made a PR #8676

bishabosha added a commit that referenced this issue Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants