Skip to content

Stack overflow while typing code with ImplicitFunction0 #2642

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
nicolasstucki opened this issue Jun 1, 2017 · 0 comments
Closed

Stack overflow while typing code with ImplicitFunction0 #2642

nicolasstucki opened this issue Jun 1, 2017 · 0 comments

Comments

@nicolasstucki
Copy link
Contributor

object Foo {
  type X = implicit () => Int
  def ff: X = ()
}
Exception in thread "main" java.lang.StackOverflowError
	at dotty.tools.dotc.ast.untpd$Function.isTerm(untpd.scala:54)
	at dotty.tools.dotc.ast.untpd$Function.isTerm(untpd.scala:54)
        ...
	at dotty.tools.dotc.ast.untpd$Function.isTerm(untpd.scala:54)
	at dotty.tools.dotc.ast.untpd$Function.isTerm(untpd.scala:54)
	at dotty.tools.dotc.ast.untpd$Function.isTerm(untpd.scala:54)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1608)
	at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1627)
	at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:140)
	at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Typer.makeImplicitFunction(Typer.scala:1624)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1611)
	at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1627)
	at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:140)
	at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Typer.makeImplicitFunction(Typer.scala:1624)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1611)
	at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1629)
@odersky odersky closed this as completed in cf346d4 Jun 1, 2017
odersky added a commit that referenced this issue Jun 1, 2017
Fix #2642: Disallow nullary implicit function types
allanrenucci added a commit to dotty-staging/dotty that referenced this issue Jan 5, 2018
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

1 participant