File tree 1 file changed +12
-12
lines changed
compiler/src/dotty/tools/dotc/config
1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ object Settings {
22
22
val OutputTag : ClassTag [AbstractFile ] = ClassTag (classOf [AbstractFile ])
23
23
24
24
class SettingsState (initialValues : Seq [Any ]) {
25
- private var values = ArrayBuffer (initialValues : _* )
25
+ private val values = ArrayBuffer (initialValues : _* )
26
26
private var _wasRead : Boolean = false
27
27
28
28
override def toString : String = s " SettingsState(values: ${values.toList}) "
@@ -89,26 +89,26 @@ object Settings {
89
89
def isDefaultIn (state : SettingsState ): Boolean = valueIn(state) == default
90
90
91
91
def legalChoices : String =
92
- if ( choices.isEmpty) " "
93
- else choices match {
94
- case r : Range => s " ${r.head}.. ${r.last}"
95
- case xs : List [? ] => xs.mkString( " , " )
92
+ choices match {
93
+ case xs if xs.isEmpty => " "
94
+ case r : Range => s " ${r.head}.. ${r.last}"
95
+ case xs : List [? ] => xs.toString
96
96
}
97
97
98
98
def isLegal (arg : Any ): Boolean =
99
- if ( choices.isEmpty)
100
- arg match {
101
- case _ : T => true
102
- case _ => false
103
- }
104
- else choices match {
99
+ choices match {
100
+ case xs if xs.isEmpty =>
101
+ arg match {
102
+ case _ : T => true
103
+ case _ => false
104
+ }
105
105
case r : Range =>
106
106
arg match {
107
107
case x : Int => r.head <= x && x <= r.last
108
108
case _ => false
109
109
}
110
110
case xs : List [? ] =>
111
- xs contains arg
111
+ xs. contains( arg)
112
112
}
113
113
114
114
def tryToSet (state : ArgsSummary ): ArgsSummary = {
You can’t perform that action at this time.
0 commit comments