Skip to content

Commit f4ceaf3

Browse files
author
Sara Alemanno
committed
Update StringContextMacro.scala
1 parent 26b5080 commit f4ceaf3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/src-3.x/dotty/internal/StringContextMacro.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ object StringContextMacro {
704704
if (!reporter.hasReported()){
705705
val conversionWithType = checkFormatSpecifiers(0, hasArgumentIndex, argumentIndex, None, maxArgumentIndex, hasRelative, hasWidth, width, hasPrecision, precision, flags, conversion, None, part)
706706
nextStart = conversion + 1
707-
if (!reporter.hasReported() && part.charAt(conversion) != '%' && part.charAt(conversion) != 'n')
707+
if (!reporter.hasReported() && part.charAt(conversion) != '%' && part.charAt(conversion) != 'n' && !hasArgumentIndex && !hasRelative)
708708
reporter.partError("conversions must follow a splice; use %% for literal %, %n for newline", 0, part.indexOf('%'))
709709
conversionWithType :: checkPart(part, nextStart, argument, maxArgumentIndex)
710710
} else checkPart(part, conversion + 1, argument, maxArgumentIndex)

0 commit comments

Comments
 (0)