Skip to content

Commit c0491e0

Browse files
tudorv91bishabosha
andcommitted
Update compiler/src/dotty/tools/dotc/core/NameOps.scala
Co-authored-by: Jamie Thompson <bishbashboshjt@gmail.com>
1 parent 6aa176c commit c0491e0

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

.jvmopts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-Xss1m
2-
-Xms512m
3-
-Xmx1200m
1+
-Xss10m
2+
-Xms1024m
3+
-Xmx4096m
44
-XX:MaxInlineLevel=35

compiler/src/dotty/tools/dotc/core/NameOps.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ object NameOps {
134134
}
135135

136136
/** Does the name match `extension`? */
137-
def isExtension: Boolean = name.toString == "extension"
137+
def isExtension: Boolean = name match
138+
case name: SimpleName =>
139+
name.length == "extension".length && name.startsWith("extension")
140+
case _ => false
138141

139142
/** Does this name start with `extension_`? */
140143
def isExtensionName: Boolean = name match

tests/neg/illegal-extension.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
-- Error: tests/neg/illegal-extension.scala:5:14 -----------------------------------------------------------------------
1010
5 | private var extension = Nil // error: not allowed because it matches `extension`
1111
| ^^^^^^^^^
12-
| illegal variable name: `extension`
12+
| illegal setter name: `extension_=`
1313
-- Error: tests/neg/illegal-extension.scala:8:23 -----------------------------------------------------------------------
1414
8 |extension (x: Any) def extension_foo: String = "foo" // error: illegal name: extension_foo may not start with `extension_`
1515
| ^^^^^^^^^^^^^

0 commit comments

Comments
 (0)