Skip to content

Commit

Permalink
Allow Quote and If
Browse files Browse the repository at this point in the history
  • Loading branch information
mbovel committed Nov 22, 2024
1 parent 5d668e6 commit a7bd23b
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions compiler/src/dotty/tools/dotc/typer/Checking.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1433,30 +1433,35 @@ trait Checking {
tree match
case _ if tree.isType =>
super.transform(tree)
case _: ( Literal
case _: ( EmptyTree.type
| Ident
| This
| New
| Select
| This
| Super
| Apply
| TypeApply
| SeqLiteral
| Literal
| New
| Typed
| NamedArg
| Assign
| Block
| ValDef
| DefDef
| If
| Closure
| NamedArg
| EmptyTree.type
| Return
| SeqLiteral
| Inlined
| Quote
| Splice
| Hole
| Inlined) =>
| ValDef
| DefDef
| Annotated) =>
super.transform(tree)
case _ =>
errorTree(
EmptyTree,
em"""Implementation restriction: this tree cannot be used in an annotation.
|Tree: ${tree}
|Tree: ${tree.toString()}
|Type: ${tree.tpe}""",
tree.srcPos
)
Expand Down

0 comments on commit a7bd23b

Please sign in to comment.