Skip to content

Commit 4ae950d

Browse files
committed
Make DeprecatedAssignmentSyntax have an Deprecatated instead fo Ambigious syntax in it's body
1 parent d08277f commit 4ae950d

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

compiler/src/dotty/tools/dotc/reporting/messages.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -3362,7 +3362,7 @@ end QuotedTypeMissing
33623362

33633363
final class DeprecatedAssignmentSyntax(key: Name, value: untpd.Tree)(using Context) extends SyntaxMsg(DeprecatedAssignmentSyntaxID):
33643364
override protected def msg(using Context): String =
3365-
i"""Ambiguous syntax: this is interpreted as a named tuple with one element,
3365+
i"""Deprecated syntax: since 3.7 this is interpreted as a named tuple with one element,
33663366
|not as an assignment.
33673367
|
33683368
|To assign a value, use curly braces: `{${key} = ${value}}`."""

tests/warn/21681.check

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- [E203] Syntax Migration Warning: tests/warn/21681.scala:3:2 ---------------------------------------------------------
22
3 | (age = 29) // warn
33
| ^^^^^^^^^^
4-
| Ambiguous syntax: this is interpreted as a named tuple with one element,
4+
| Deprecated syntax: since 3.7 this is interpreted as a named tuple with one element,
55
| not as an assignment.
66
|
77
| To assign a value, use curly braces: `{age = 29}`.

tests/warn/21681b.check

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- [E203] Syntax Migration Warning: tests/warn/21681b.scala:3:2 --------------------------------------------------------
22
3 | (age = 29) // warn
33
| ^^^^^^^^^^
4-
| Ambiguous syntax: this is interpreted as a named tuple with one element,
4+
| Deprecated syntax: since 3.7 this is interpreted as a named tuple with one element,
55
| not as an assignment.
66
|
77
| To assign a value, use curly braces: `{age = 29}`.

tests/warn/21681c.check

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- [E203] Syntax Migration Warning: tests/warn/21681c.scala:5:2 --------------------------------------------------------
22
5 | (age = 29) // warn
33
| ^^^^^^^^^^
4-
| Ambiguous syntax: this is interpreted as a named tuple with one element,
4+
| Deprecated syntax: since 3.7 this is interpreted as a named tuple with one element,
55
| not as an assignment.
66
|
77
| To assign a value, use curly braces: `{age = 29}`.

tests/warn/21770.check

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- [E203] Syntax Migration Warning: tests/warn/21770.scala:5:9 ---------------------------------------------------------
22
5 | f(i => (cache = Some(i))) // warn
33
| ^^^^^^^^^^^^^^^^^
4-
| Ambiguous syntax: this is interpreted as a named tuple with one element,
4+
| Deprecated syntax: since 3.7 this is interpreted as a named tuple with one element,
55
| not as an assignment.
66
|
77
| To assign a value, use curly braces: `{cache = Some(i)}`.

0 commit comments

Comments
 (0)