Skip to content

SI-9273 Avoid unpositioned error for bare classOf#4449

Merged
retronym merged 1 commit intoscala:2.11.xfrom
retronym:ticket/9273
Apr 16, 2015
Merged

SI-9273 Avoid unpositioned error for bare classOf#4449
retronym merged 1 commit intoscala:2.11.xfrom
retronym:ticket/9273

Conversation

@retronym
Copy link
Member

A bare identifier classOf in a position wth an expected type of
Class[_] was leading to an unpositioned error.

This is due to special treatment of bare classOf in typedIdent
creating an ephemeral, but unpositioned, TypeTree.

This commit positions that tree and tests that the error is
issued at a sensible position.

There is still an irregularity between classOf and Predef.classOf,
but that seems esoteric enough to leave alone for now.

@scala-jenkins scala-jenkins added this to the 2.11.7 milestone Apr 15, 2015
A bare identifier `classOf` in a position wth an expected type of
`Class[_]` was leading to an unpositioned error.

This is due to special treatment of bare `classOf` in `typedIdent`
creating an ephemeral, but unpositioned, `TypeTree`.

This commit positions that tree and tests that the error is
issued at a sensible position.

There is still an irregularity between `classOf` and `Predef.classOf`,
but that seems esoteric enough to leave alone for now.
@adriaanm
Copy link
Contributor

LGTM

@soc
Copy link
Contributor

soc commented Apr 15, 2015

@retronym I'm working on code which removes all special-casing for classOf in the compiler, that should remove the remaining issues.

@retronym
Copy link
Member Author

@soc Look forward to seeing that!

retronym added a commit that referenced this pull request Apr 16, 2015
SI-9273 Avoid unpositioned error for bare classOf
@retronym retronym merged commit d2a174d into scala:2.11.x Apr 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants