Skip to content

Using empty refinement "{}" as a type by itself crashes in assertPositioned #1867

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
helloqirun opened this issue Jan 1, 2017 · 3 comments
Closed

Comments

@helloqirun
Copy link

helloqirun commented Jan 1, 2017

scalac compiles but dotc crashes.

$ cat abc.scala

trait B {
  def f1: {}
}

$ dotc abc.scala

exception occurred while typechecking abc.scala

exception occurred while compiling abc.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: position not set for TypeDef(<refinement>,Template(DefDef(<init>,List(),List(),TypeTree,EmptyTree),List(TypedSplice(TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,lang)),Object)])),ValDef(_,EmptyTree,EmptyTree),List())) # 59
	at scala.Predef$.assert(Predef.scala:165)
	at dotty.tools.dotc.typer.Typer$.assertPositioned(Typer.scala:59)
	at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1552)
	at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1551)
	at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:136)
	at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1551)
<...>
@smarter smarter changed the title crash on compilable code: position not set for... Using empty refinement "{}" as a type by itself crashes in assertPositioned Jan 1, 2017
@odersky
Copy link
Contributor

odersky commented Jan 7, 2017

Fixed by above PR.

@odersky odersky closed this as completed Jan 7, 2017
@smarter
Copy link
Member

smarter commented Jan 7, 2017

@odersky I see the fix in https://github.com/dotty-staging/dotty/commits/fix-%231867 but this hasn't been merged into master and there is no open PR for it?

@smarter smarter reopened this Jan 7, 2017
@odersky
Copy link
Contributor

odersky commented Jan 7, 2017 via email

@smarter smarter self-assigned this Jan 7, 2017
@smarter smarter closed this as completed in 0ca3728 Jan 7, 2017
smarter added a commit that referenced this issue Jan 7, 2017
Fix #1867: Set position of empty refined types
b-studios pushed a commit to b-studios/dotty that referenced this issue Jan 8, 2017
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