Skip to content
This repository
Browse code

Name boolean arguments in src/reflect.

  • Loading branch information...
commit a8d60a6c76d2d5434148c2d7c8f2bf147855252c 1 parent fff0f50
Jason Zaugg authored paulp committed
2  src/reflect/scala/reflect/internal/CapturedVariables.scala
@@ -19,7 +19,7 @@ trait CapturedVariables { self: SymbolTable =>
19 19
   /** Convert type of a captured variable to *Ref type.
20 20
    */
21 21
   def capturedVariableType(vble: Symbol): Type =
22  
-    capturedVariableType(vble, NoType, false)
  22
+    capturedVariableType(vble, NoType, erasedTypes = false)
23 23
 
24 24
   /** Convert type of a captured variable to *Ref type.
25 25
    */
2  src/reflect/scala/reflect/internal/Kinds.scala
@@ -86,7 +86,7 @@ trait Kinds {
86 86
   // plan: split into kind inference and subkinding
87 87
   // every Type has a (cached) Kind
88 88
   def kindsConform(tparams: List[Symbol], targs: List[Type], pre: Type, owner: Symbol): Boolean =
89  
-    checkKindBounds0(tparams, targs, pre, owner, false).isEmpty
  89
+    checkKindBounds0(tparams, targs, pre, owner, explainErrors = false).isEmpty
90 90
 
91 91
   /** Check whether `sym1`'s variance conforms to `sym2`'s variance.
92 92
    *
4  src/reflect/scala/reflect/internal/Positions.scala
@@ -36,7 +36,7 @@ trait Positions extends api.Positions { self: SymbolTable =>
36 36
    *  If some of the trees are ranges, returns a range position enclosing all ranges
37 37
    *  Otherwise returns default position that is either focused or not.
38 38
    */
39  
-  def wrappingPos(default: Position, trees: List[Tree]): Position = wrappingPos(default, trees, true)
  39
+  def wrappingPos(default: Position, trees: List[Tree]): Position = wrappingPos(default, trees, focus = true)
40 40
   def wrappingPos(default: Position, trees: List[Tree], focus: Boolean): Position = {
41 41
     if (useOffsetPositions) default else {
42 42
       val ranged = trees filter (_.pos.isRange)
@@ -61,7 +61,7 @@ trait Positions extends api.Positions { self: SymbolTable =>
61 61
    *  shortening the range, assigning TransparentPositions
62 62
    *  to some of the nodes in `tree` or focusing on the position.
63 63
    */
64  
-  def ensureNonOverlapping(tree: Tree, others: List[Tree]){ ensureNonOverlapping(tree, others, true) }
  64
+  def ensureNonOverlapping(tree: Tree, others: List[Tree]){ ensureNonOverlapping(tree, others, focus = true) }
65 65
   def ensureNonOverlapping(tree: Tree, others: List[Tree], focus: Boolean) {
66 66
     if (useOffsetPositions) return
67 67
 
8  src/reflect/scala/reflect/internal/Printers.scala
@@ -25,8 +25,8 @@ trait Printers extends api.Printers { self: SymbolTable =>
25 25
     if (nme.keywords(term) && term != nme.USCOREkw) "`%s`" format s
26 26
     else s
27 27
   }
28  
-  def quotedName(name: Name): String = quotedName(name, false)
29  
-  def quotedName(name: String): String = quotedName(newTermName(name), false)
  28
+  def quotedName(name: Name): String = quotedName(name, decode = false)
  29
+  def quotedName(name: String): String = quotedName(newTermName(name), decode = false)
30 30
 
31 31
   private def symNameInternal(tree: Tree, name: Name, decoded: Boolean): String = {
32 32
     val sym = tree.symbol
@@ -43,8 +43,8 @@ trait Printers extends api.Printers { self: SymbolTable =>
43 43
     }
44 44
   }
45 45
 
46  
-  def decodedSymName(tree: Tree, name: Name) = symNameInternal(tree, name, true)
47  
-  def symName(tree: Tree, name: Name) = symNameInternal(tree, name, false)
  46
+  def decodedSymName(tree: Tree, name: Name) = symNameInternal(tree, name, decoded = true)
  47
+  def symName(tree: Tree, name: Name) = symNameInternal(tree, name, decoded = false)
48 48
 
49 49
   /** Turns a path into a String, introducing backquotes
50 50
    *  as necessary.
2  src/reflect/scala/reflect/internal/Symbols.scala
@@ -2192,7 +2192,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
2192 2192
     )
2193 2193
 
2194 2194
     /** The setter of this value or getter definition, or NoSymbol if none exists */
2195  
-    final def setter(base: Symbol): Symbol = setter(base, false)
  2195
+    final def setter(base: Symbol): Symbol = setter(base, hasExpandedName = false)
2196 2196
 
2197 2197
     final def setter(base: Symbol, hasExpandedName: Boolean): Symbol = {
2198 2198
       var sname = nme.getterToSetter(nme.getterName(name.toTermName))
26  src/reflect/scala/reflect/internal/Types.scala
@@ -705,7 +705,7 @@ trait Types extends api.Types { self: SymbolTable =>
705 705
       findMembers(excludedFlags, requiredFlags)
706 706
 
707 707
     def memberBasedOnName(name: Name, excludedFlags: Long): Symbol =
708  
-      findMember(name, excludedFlags, 0, false)
  708
+      findMember(name, excludedFlags, 0, stableOnly = false)
709 709
 
710 710
     /** The least type instance of given class which is a supertype
711 711
      *  of this type.  Example:
@@ -925,7 +925,7 @@ trait Types extends api.Types { self: SymbolTable =>
925 925
     def matches(that: Type): Boolean = matchesType(this, that, !phase.erasedTypes)
926 926
 
927 927
     /** Same as matches, except that non-method types are always assumed to match. */
928  
-    def looselyMatches(that: Type): Boolean = matchesType(this, that, true)
  928
+    def looselyMatches(that: Type): Boolean = matchesType(this, that, alwaysMatchSimple = true)
929 929
 
930 930
     /** The shortest sorted upwards closed array of types that contains
931 931
      *  this type as first element.
@@ -2844,7 +2844,7 @@ trait Types extends api.Types { self: SymbolTable =>
2844 2844
       val tvars = quantifiedFresh map (tparam => TypeVar(tparam))
2845 2845
       val underlying1 = underlying.instantiateTypeParams(quantified, tvars) // fuse subst quantified -> quantifiedFresh -> tvars
2846 2846
       op(underlying1) && {
2847  
-        solve(tvars, quantifiedFresh, quantifiedFresh map (_ => Invariant), false, depth) &&
  2847
+        solve(tvars, quantifiedFresh, quantifiedFresh map (_ => Invariant), upper = false, depth) &&
2848 2848
         isWithinBounds(NoPrefix, NoSymbol, quantifiedFresh, tvars map (_.constr.inst))
2849 2849
       }
2850 2850
     }
@@ -3259,7 +3259,7 @@ trait Types extends api.Types { self: SymbolTable =>
3259 3259
      * (`T` corresponds to @param sym)
3260 3260
      */
3261 3261
     def registerTypeSelection(sym: Symbol, tp: Type): Boolean = {
3262  
-      registerBound(HasTypeMember(sym.name.toTypeName, tp), false)
  3262
+      registerBound(HasTypeMember(sym.name.toTypeName, tp), isLowerBound = false)
3263 3263
     }
3264 3264
 
3265 3265
     private def isSkolemAboveLevel(tp: Type) = tp.typeSymbol match {
@@ -5035,7 +5035,7 @@ trait Types extends api.Types { self: SymbolTable =>
5035 5035
         }
5036 5036
       }
5037 5037
       else {
5038  
-        var rebind0 = pre.findMember(sym.name, BRIDGE, 0, true) orElse {
  5038
+        var rebind0 = pre.findMember(sym.name, BRIDGE, 0, stableOnly = true) orElse {
5039 5039
           if (sym.isAliasType) throw missingAliasException
5040 5040
           devWarning(s"$pre.$sym no longer exist at phase $phase")
5041 5041
           throw new MissingTypeControl // For build manager and presentation compiler purposes
@@ -5840,7 +5840,7 @@ trait Types extends api.Types { self: SymbolTable =>
5840 5840
           case AnnotatedType(_, _, _) | BoundedWildcardType(_) =>
5841 5841
             secondTry
5842 5842
           case _ =>
5843  
-            tv2.registerBound(tp1, true)
  5843
+            tv2.registerBound(tp1, isLowerBound = true)
5844 5844
         }
5845 5845
       case _ =>
5846 5846
         secondTry
@@ -5858,7 +5858,7 @@ trait Types extends api.Types { self: SymbolTable =>
5858 5858
       case BoundedWildcardType(bounds) =>
5859 5859
         isSubType(tp1.bounds.lo, tp2, depth)
5860 5860
       case tv @ TypeVar(_,_) =>
5861  
-        tv.registerBound(tp2, false)
  5861
+        tv.registerBound(tp2, isLowerBound = false)
5862 5862
       case ExistentialType(_, _) =>
5863 5863
         try {
5864 5864
           skolemizationLevel += 1
@@ -6036,7 +6036,7 @@ trait Types extends api.Types { self: SymbolTable =>
6036 6036
     def lastTry =
6037 6037
       tp2 match {
6038 6038
         case ExistentialType(_, res2) if alwaysMatchSimple =>
6039  
-          matchesType(tp1, res2, true)
  6039
+          matchesType(tp1, res2, alwaysMatchSimple = true)
6040 6040
         case MethodType(_, _) =>
6041 6041
           false
6042 6042
         case PolyType(_, _) =>
@@ -6056,7 +6056,7 @@ trait Types extends api.Types { self: SymbolTable =>
6056 6056
             if (params1.isEmpty) matchesType(res1, res2, alwaysMatchSimple)
6057 6057
             else matchesType(tp1, res2, alwaysMatchSimple)
6058 6058
           case ExistentialType(_, res2) =>
6059  
-            alwaysMatchSimple && matchesType(tp1, res2, true)
  6059
+            alwaysMatchSimple && matchesType(tp1, res2, alwaysMatchSimple = true)
6060 6060
           case TypeRef(_, sym, Nil) =>
6061 6061
             params1.isEmpty && sym.isModuleClass && matchesType(res1, tp2, alwaysMatchSimple)
6062 6062
           case _ =>
@@ -6069,7 +6069,7 @@ trait Types extends api.Types { self: SymbolTable =>
6069 6069
           case NullaryMethodType(res2) =>
6070 6070
             matchesType(res1, res2, alwaysMatchSimple)
6071 6071
           case ExistentialType(_, res2) =>
6072  
-            alwaysMatchSimple && matchesType(tp1, res2, true)
  6072
+            alwaysMatchSimple && matchesType(tp1, res2, alwaysMatchSimple = true)
6073 6073
           case TypeRef(_, sym, Nil) if sym.isModuleClass =>
6074 6074
             matchesType(res1, tp2, alwaysMatchSimple)
6075 6075
           case _ =>
@@ -6083,7 +6083,7 @@ trait Types extends api.Types { self: SymbolTable =>
6083 6083
             else
6084 6084
               matchesQuantified(tparams1, tparams2, res1, res2)
6085 6085
           case ExistentialType(_, res2) =>
6086  
-            alwaysMatchSimple && matchesType(tp1, res2, true)
  6086
+            alwaysMatchSimple && matchesType(tp1, res2, alwaysMatchSimple = true)
6087 6087
           case _ =>
6088 6088
             false // remember that tparams1.nonEmpty is now an invariant of PolyType
6089 6089
         }
@@ -6092,7 +6092,7 @@ trait Types extends api.Types { self: SymbolTable =>
6092 6092
           case ExistentialType(tparams2, res2) =>
6093 6093
             matchesQuantified(tparams1, tparams2, res1, res2)
6094 6094
           case _ =>
6095  
-            if (alwaysMatchSimple) matchesType(res1, tp2, true)
  6095
+            if (alwaysMatchSimple) matchesType(res1, tp2, alwaysMatchSimple = true)
6096 6096
             else lastTry
6097 6097
         }
6098 6098
       case TypeRef(_, sym, Nil) if sym.isModuleClass =>
@@ -6288,7 +6288,7 @@ trait Types extends api.Types { self: SymbolTable =>
6288 6288
 
6289 6289
     val columns: List[Column[List[Type]]] = mapWithIndex(sorted) {
6290 6290
       case ((k, v), idx) =>
6291  
-        Column(str(k), (xs: List[Type]) => str(xs(idx)), true)
  6291
+        Column(str(k), (xs: List[Type]) => str(xs(idx)), left = true)
6292 6292
     }
6293 6293
 
6294 6294
     val tableDef = TableDef(columns: _*)
4  src/reflect/scala/reflect/internal/util/TableDef.scala
@@ -19,8 +19,8 @@ class TableDef[T](_cols: Column[T]*) {
19 19
    *      if none is specified, a space is used.
20 20
    */
21 21
   def ~(next: Column[T])            = retThis(cols :+= next)
22  
-  def >>(pair: (String, T => Any))  = this ~ Column(pair._1, pair._2, false)
23  
-  def <<(pair: (String, T => Any))  = this ~ Column(pair._1, pair._2, true)
  22
+  def >>(pair: (String, T => Any))  = this ~ Column(pair._1, pair._2, left = false)
  23
+  def <<(pair: (String, T => Any))  = this ~ Column(pair._1, pair._2, left = true)
24 24
   def >+(sep: String)               = retThis(separators += ((cols.size - 1, sep)))
25 25
 
26 26
   /** Below this point should all be considered private/internal.
4  src/reflect/scala/reflect/io/AbstractFile.scala
@@ -227,7 +227,7 @@ abstract class AbstractFile extends Iterable[AbstractFile] {
227 227
    */
228 228
   def fileNamed(name: String): AbstractFile = {
229 229
     assert(isDirectory, "Tried to find '%s' in '%s' but it is not a directory".format(name, path))
230  
-    fileOrSubdirectoryNamed(name, false)
  230
+    fileOrSubdirectoryNamed(name, isDir = false)
231 231
   }
232 232
 
233 233
   /**
@@ -236,7 +236,7 @@ abstract class AbstractFile extends Iterable[AbstractFile] {
236 236
    */
237 237
   def subdirectoryNamed(name: String): AbstractFile = {
238 238
     assert (isDirectory, "Tried to find '%s' in '%s' but it is not a directory".format(name, path))
239  
-    fileOrSubdirectoryNamed(name, true)
  239
+    fileOrSubdirectoryNamed(name, isDir = true)
240 240
   }
241 241
 
242 242
   protected def unsupported(): Nothing = unsupported(null)
2  src/reflect/scala/reflect/io/File.scala
@@ -72,7 +72,7 @@ class File(jfile: JFile)(implicit constructorCodec: Codec) extends Path(jfile) w
72 72
 
73 73
   /** Wraps a BufferedWriter around the result of writer().
74 74
    */
75  
-  def bufferedWriter(): BufferedWriter = bufferedWriter(false)
  75
+  def bufferedWriter(): BufferedWriter = bufferedWriter(append = false)
76 76
   def bufferedWriter(append: Boolean): BufferedWriter = bufferedWriter(append, creationCodec)
77 77
   def bufferedWriter(append: Boolean, codec: Codec): BufferedWriter =
78 78
     new BufferedWriter(writer(append, codec))
4  src/reflect/scala/reflect/io/VirtualDirectory.scala
@@ -54,14 +54,14 @@ extends AbstractFile {
54 54
     (files get name filter (_.isDirectory == directory)).orNull
55 55
 
56 56
   override def fileNamed(name: String): AbstractFile =
57  
-    Option(lookupName(name, false)) getOrElse {
  57
+    Option(lookupName(name, directory = false)) getOrElse {
58 58
       val newFile = new VirtualFile(name, path+'/'+name)
59 59
       files(name) = newFile
60 60
       newFile
61 61
     }
62 62
 
63 63
   override def subdirectoryNamed(name: String): AbstractFile =
64  
-    Option(lookupName(name, true)) getOrElse {
  64
+    Option(lookupName(name, directory = true)) getOrElse {
65 65
       val dir = new VirtualDirectory(name, Some(this))
66 66
       files(name) = dir
67 67
       dir
4  src/reflect/scala/reflect/io/ZipArchive.scala
@@ -39,8 +39,8 @@ object ZipArchive {
39 39
    */
40 40
   def fromURL(url: URL): URLZipArchive = new URLZipArchive(url)
41 41
 
42  
-  private def dirName(path: String)  = splitPath(path, true)
43  
-  private def baseName(path: String) = splitPath(path, false)
  42
+  private def dirName(path: String)  = splitPath(path, front = true)
  43
+  private def baseName(path: String) = splitPath(path, front = false)
44 44
   private def splitPath(path0: String, front: Boolean): String = {
45 45
     val isDir = path0.charAt(path0.length - 1) == '/'
46 46
     val path  = if (isDir) path0.substring(0, path0.length - 1) else path0

0 notes on commit a8d60a6

Please sign in to comment.
Something went wrong with that request. Please try again.