Skip to content

Commit 7e26ac3

Browse files
Remove view bounds 🔥
1 parent 578d400 commit 7e26ac3

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ object Parsers {
296296
def deprecationWarning(msg: => Message, offset: Int = in.offset): Unit =
297297
ctx.deprecationWarning(msg, source.atSpan(Span(offset)))
298298

299+
def errorOrMigrationWarning(msg: => Message, offset: Int = in.offset): Unit =
300+
ctx.errorOrMigrationWarning(msg, source.atSpan(Span(offset)))
301+
299302
/** Issue an error at current offset that input is incomplete */
300303
def incompleteInputError(msg: => Message): Unit =
301304
ctx.incompleteInputError(msg, source.atSpan(Span(in.offset)))
@@ -1135,7 +1138,7 @@ object Parsers {
11351138
AppliedTypeTree(toplevelTyp(), Ident(pname))
11361139
} :: contextBounds(pname)
11371140
case VIEWBOUND =>
1138-
deprecationWarning("view bounds `<%' are deprecated, use a context bound `:' instead")
1141+
errorOrMigrationWarning("view bounds `<%' are deprecated, use a context bound `:' instead")
11391142
atSpan(in.skipToken()) {
11401143
Function(Ident(pname) :: Nil, toplevelTyp())
11411144
} :: contextBounds(pname)

compiler/src/dotty/tools/dotc/parsing/Tokens.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ abstract class TokensCommon {
112112
//final val SUPERTYPE = 81; enter(SUPERTYPE, ">:")
113113
//final val HASH = 82; enter(HASH, "#")
114114
final val AT = 83; enter(AT, "@")
115-
//final val VIEWBOUND = 84; enter(VIEWBOUND, "<%") // TODO: deprecate
115+
//final val VIEWBOUND = 84; enter(VIEWBOUND, "<%")
116116

117117
val keywords: TokenSet
118118

@@ -193,7 +193,7 @@ object Tokens extends TokensCommon {
193193
final val SUBTYPE = 80; enter(SUBTYPE, "<:")
194194
final val SUPERTYPE = 81; enter(SUPERTYPE, ">:")
195195
final val HASH = 82; enter(HASH, "#")
196-
final val VIEWBOUND = 84; enter(VIEWBOUND, "<%") // TODO: deprecate
196+
final val VIEWBOUND = 84; enter(VIEWBOUND, "<%")
197197
final val QUOTE = 85; enter(QUOTE, "'")
198198

199199
/** XML mode */

docs/docs/internals/syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ NamedTypeArg ::= id ‘=’ Type
171171
NamedTypeArgs ::= ‘[’ NamedTypeArg {‘,’ NamedTypeArg} ‘]’ nts
172172
Refinement ::= ‘{’ [RefineDcl] {semi [RefineDcl]} ‘}’ ds
173173
SubtypeBounds ::= [‘>:’ Type] [‘<:’ Type] | INT TypeBoundsTree(lo, hi)
174-
TypeParamBounds ::= SubtypeBounds {‘<%’ Type} {‘:’ Type} ContextBounds(typeBounds, tps)
174+
TypeParamBounds ::= SubtypeBounds {‘:’ Type} ContextBounds(typeBounds, tps)
175175
```
176176

177177
### Expressions
File renamed without changes.

0 commit comments

Comments
 (0)