Skip to content

Compiler crashes on IArray(1,2,3).exists(_ > 0) #8195

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
LPTK opened this issue Feb 4, 2020 · 2 comments
Closed

Compiler crashes on IArray(1,2,3).exists(_ > 0) #8195

LPTK opened this issue Feb 4, 2020 · 2 comments

Comments

@LPTK
Copy link
Contributor

LPTK commented Feb 4, 2020

[info] running (fork) dotty.tools.repl.Main -classpath Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.1/scala-library-2.13.1.jar:out/bootstrap/dotty-library-bootstrapped/scala-0.23/dotty-library_0.23-0.23.0-bin-SNAPSHOT.jar
scala> IArray(1,2,3).exists(_ > 0)
Exception in thread "main" java.lang.NullPointerException
	at dotty.tools.dotc.core.NameKinds$UniqueNameKind.fresh(NameKinds.scala:218)
	at dotty.tools.dotc.parsing.Parsers$Parser.simpleExpr(Parsers.scala:2204)
	at dotty.tools.dotc.parsing.Parsers$Parser.$init$$$anonfun$7(Parsers.scala:2172)
	at dotty.tools.dotc.parsing.Parsers$Parser.postfixExpr(Parsers.scala:2156)
	at dotty.tools.dotc.parsing.Parsers$Parser.expr1(Parsers.scala:2017)
	at dotty.tools.dotc.parsing.Parsers$Parser.expr(Parsers.scala:1891)
	at dotty.tools.dotc.parsing.Parsers$Parser.$init$$$anonfun$5(Parsers.scala:1870)
	at dotty.tools.dotc.parsing.Parsers$Parser.$init$$$anonfun$8(Parsers.scala:2320)
	at dotty.tools.dotc.parsing.Parsers$Parser.tokenSeparated(Parsers.scala:601)
	at dotty.tools.dotc.parsing.Parsers$Parser.commaSeparated(Parsers.scala:609)
	at dotty.tools.dotc.parsing.Parsers$Parser.parArgumentExprs$$anonfun$1(Parsers.scala:2306)
	at dotty.tools.dotc.parsing.Parsers$Parser.enclosed(Parsers.scala:569)
	at dotty.tools.dotc.parsing.Parsers$Parser.inParens(Parsers.scala:576)
	at dotty.tools.dotc.parsing.Parsers$Parser.parArgumentExprs(Parsers.scala:2307)
	at dotty.tools.dotc.parsing.Parsers$Parser.argumentExprs(Parsers.scala:2313)
	at dotty.tools.dotc.parsing.Parsers$Parser.simpleExprRest(Parsers.scala:2261)
	at dotty.tools.dotc.parsing.Parsers$Parser.simpleExprRest(Parsers.scala:2256)
	at dotty.tools.dotc.parsing.Parsers$Parser.simpleExprRest(Parsers.scala:2262)
	at dotty.tools.dotc.parsing.Parsers$Parser.simpleExpr(Parsers.scala:2248)
	at dotty.tools.dotc.parsing.Parsers$Parser.$init$$$anonfun$7(Parsers.scala:2172)
	at dotty.tools.dotc.parsing.Parsers$Parser.postfixExpr(Parsers.scala:2156)
	at dotty.tools.dotc.parsing.Parsers$Parser.expr1(Parsers.scala:2017)
	at dotty.tools.dotc.parsing.Parsers$Parser.expr(Parsers.scala:1891)
	at dotty.tools.dotc.parsing.Parsers$Parser.blockStatSeq$$anonfun$1(Parsers.scala:3856)
	at dotty.tools.dotc.parsing.Parsers$Parser.checkNoEscapingPlaceholders(Parsers.scala:510)
	at dotty.tools.dotc.parsing.Parsers$Parser.blockStatSeq(Parsers.scala:3868)
	at dotty.tools.repl.ParseResult$.parseStats(ParseResult.scala:113)
	at dotty.tools.repl.ParseResult$.isIncomplete$$anonfun$2(ParseResult.scala:165)
	at dotty.tools.dotc.reporting.Reporter.withIncompleteHandler(Reporter.scala:221)
	at dotty.tools.repl.ParseResult$.isIncomplete(ParseResult.scala:166)
	at dotty.tools.repl.JLineTerminal$Parser.acceptLine$1(JLineTerminal.scala:130)
	at dotty.tools.repl.JLineTerminal$Parser.parse(JLineTerminal.scala:134)
	at org.jline.reader.impl.LineReaderImpl.acceptLine(LineReaderImpl.java:2731)
	at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:585)
	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(ReplDriver.scala:148)
	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)
[error] Nonzero exit code returned from runner: 1
[error] (dotty-compiler / Compile / runMain) Nonzero exit code returned from runner: 1

This does not happen with IArray(1,2,3).exists(x => x > 0), but the latter crashes because of a bug in the implementation of exists (it contains an erroneous cast).

@som-snytt
Copy link
Contributor

Your stack trace is #7934

@smarter
Copy link
Member

smarter commented Feb 4, 2020

Yes, this is a duplicate of #7934.

@smarter smarter closed this as completed Feb 4, 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

3 participants