Skip to content

Typer calls NoDenotation.owner if bad structural type #62

Closed
@samuelgruetter

Description

@samuelgruetter

[Low priority]

In this example,

object test {
  type X = { val m: BadType }
}

the BadType is correctly rejected, but then typechecking continues and throws an uncaught exception:

[error] tests/neg/NoDenotationOwner.scala:2: error: not found: type BadType
[error]   type X = { val m: BadType }
[error]                     ^
[info] exception occured while typechecking tests/neg/NoDenotationOwner.scala
[error] Exception in thread "main" java.lang.AssertionError: NoDenotation.owner
[error]     at dotty.tools.dotc.core.SymDenotations$NoDenotation$.owner(SymDenotations.scala:1228)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typedRefinedTypeTree$1$$anonfun$dotty$tools$dotc$typer$Typer$$anonfun$$addRefinement$1$2.apply(Typer.scala:671)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typedRefinedTypeTree$1$$anonfun$dotty$tools$dotc$typer$Typer$$anonfun$$addRefinement$1$2.apply(Typer.scala:669)
[error]     at dotty.tools.dotc.ast.Trees$Instance$$anon$1.traverse(Trees.scala:889)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions