Skip to content

Commit 11fdce9

Browse files
committed
Resolve some todos
1 parent 17dfdbd commit 11fdce9

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,6 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
750750
val close = if (body.isTerm) keywordStr("}") else keywordStr("]")
751751
keywordStr("'") ~ quotesText ~ open ~ bindingsText ~ toTextGlobal(body) ~ close
752752
case SplicePattern(pattern, typeargs, args) =>
753-
// TODO-18271: Add tests?
754753
val spliceTypeText = (keywordStr("[") ~ toTextGlobal(tree.typeOpt) ~ keywordStr("]")).provided(printDebug && tree.typeOpt.exists)
755754
keywordStr("$") ~ spliceTypeText ~ {
756755
if typeargs.isEmpty && args.isEmpty then keywordStr("{") ~ inPattern(toText(pattern)) ~ keywordStr("}")

compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,6 @@ trait QuotesAndSplices {
122122
val typedTypeargs = tree.typeargs.map {
123123
case typearg: untpd.Ident =>
124124
val typedTypearg = typedType(typearg)
125-
/* TODO-18271: Allow type bounds?
126-
* (NOTE: Needs non-trivial extension to type system)
127-
*/
128125
val bounds = ctx.gadt.fullBounds(typedTypearg.symbol)
129126
if bounds != null && bounds != TypeBounds.empty then
130127
report.error("Implementation restriction: Type arguments to Open pattern are expected to have no bounds", typearg.srcPos)
@@ -179,17 +176,14 @@ trait QuotesAndSplices {
179176
/** Types a splice applied to some type arguments and arguments
180177
* `$f[targs1, ..., targsn](arg1, ..., argn)` in a quote pattern.
181178
*
182-
* TODO-18217: Remove follwing notes on complete
183-
* Refer to: typedTypeApply
179+
* Refer to: typedAppliedSplice
184180
*/
185181
def typedAppliedSpliceWithTypes(tree: untpd.Apply, pt: Type)(using Context): Tree = {
186182
assert(ctx.mode.isQuotedPattern)
187183
val untpd.Apply(typeApplyTree @ untpd.TypeApply(splice: untpd.SplicePattern, typeargs), args) = tree: @unchecked
188184
def isInBraces: Boolean = splice.span.end != splice.body.span.end
189185
if isInBraces then // ${x}[...](...) match an application
190-
// TODO-18127: typedTypeApply cares about named arguments. Do we want to care as well?
191186
val typedTypeargs = typeargs.map(arg => typedType(arg))
192-
// TODO-18217: Why do we use typedExpr here?
193187
val typedArgs = args.map(arg => typedExpr(arg))
194188
val argTypes = typedArgs.map(_.tpe.widenTermRefExpr)
195189
val splice1 = typedSplicePattern(splice, ProtoTypes.PolyProto(typedArgs, defn.FunctionOf(argTypes, pt)))
@@ -198,7 +192,6 @@ trait QuotesAndSplices {
198192
else // $x[...](...) higher-order quasipattern
199193
// Empty args is allowed
200194
if typeargs.isEmpty then
201-
// TODO-18271: Better error message
202195
report.error("Missing type arguments for open pattern", tree.srcPos)
203196
typedSplicePattern(untpd.cpy.SplicePattern(tree)(splice.body, typeargs, args), pt)
204197
}

0 commit comments

Comments
 (0)