Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Add back the optional .type #88

Merged
merged 1 commit into from
Nov 17, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -960,12 +960,12 @@ self =>
wildcardType(in.skipToken())
case tok if sip23 && isLiteralToken(tok) => // SIP-23
// allowing an optional `.type` suffix:
/*val lit = literal()
val lit = literal()
if (in.token == DOT && lookingAhead { in.token == TYPE }) {
accept(DOT)
accept(TYPE)
}*/
atPos(start){SingletonTypeTree(literal())}
}
atPos(start){SingletonTypeTree(lit)}
case _ =>
path(thisOK = false, typeOK = true) match {
case r @ SingletonTypeTree(_) => r
Expand Down
4 changes: 2 additions & 2 deletions test/files/run/sip-23-type-equality.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ object Test extends App {
val y: x.type = 1

implicitly[x.type =:= y.type]
implicitly[1 =:= y.type]
implicitly[1 =:= x.type]
implicitly[1 =:= y.type]
implicitly[1.type =:= x.type]
}