Permalink
Browse files

Fixes #4490 and #4467.

  • Loading branch information...
1 parent 8e10b05 commit 60c8697f0c39f71c7e735ad02f483cd8779c3567 @kzys kzys committed Jun 18, 2011
Showing with 1,033 additions and 1,092 deletions.
  1. +1 −1 src/build/genprod.scala
  2. +8 −8 src/compiler/scala/reflect/internal/BaseTypeSeqs.scala
  3. +3 −3 src/compiler/scala/reflect/internal/NameManglers.scala
  4. +34 −60 src/compiler/scala/reflect/internal/Names.scala
  5. +11 −11 src/compiler/scala/reflect/internal/SymbolTable.scala
  6. +49 −49 src/compiler/scala/reflect/internal/Symbols.scala
  7. +3 −3 src/compiler/scala/reflect/internal/TreeGen.scala
  8. +3 −3 src/compiler/scala/reflect/internal/TreeInfo.scala
  9. +13 −13 src/compiler/scala/reflect/internal/Trees.scala
  10. +151 −175 src/compiler/scala/reflect/internal/Types.scala
  11. +1 −1 src/compiler/scala/tools/nsc/ast/DocComments.scala
  12. +3 −3 src/compiler/scala/tools/nsc/ast/TreeGen.scala
  13. +88 −88 src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
  14. +2 −2 src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala
  15. +2 −2 src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala
  16. +3 −3 src/compiler/scala/tools/nsc/backend/icode/ExceptionHandlers.scala
  17. +5 −5 src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
  18. +3 −3 src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala
  19. +1 −1 src/compiler/scala/tools/nsc/backend/icode/analysis/Liveness.scala
  20. +3 −3 src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
  21. +1 −1 src/compiler/scala/tools/nsc/backend/msil/GenMSIL.scala
  22. +1 −1 src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
  23. +1 −1 src/compiler/scala/tools/nsc/interactive/BuildManager.scala
  24. +2 −2 src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
  25. +1 −1 src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
  26. +1 −1 src/compiler/scala/tools/nsc/interactive/SimpleBuildManager.scala
  27. +1 −1 src/compiler/scala/tools/nsc/io/AbstractFile.scala
  28. +3 −3 src/compiler/scala/tools/nsc/io/Pickler.scala
  29. +3 −3 src/compiler/scala/tools/nsc/javac/JavaParsers.scala
  30. +3 −3 src/compiler/scala/tools/nsc/matching/Matrix.scala
  31. +1 −1 src/compiler/scala/tools/nsc/matching/PatternBindings.scala
  32. +2 −2 src/compiler/scala/tools/nsc/settings/MutableSettings.scala
  33. +2 −2 src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala
  34. +2 −2 src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
  35. +1 −1 src/compiler/scala/tools/nsc/symtab/clr/TypeParser.scala
  36. +2 −2 src/compiler/scala/tools/nsc/transform/AddInterfaces.scala
  37. +3 −3 src/compiler/scala/tools/nsc/transform/Constructors.scala
  38. +3 −3 src/compiler/scala/tools/nsc/transform/Erasure.scala
  39. +8 −8 src/compiler/scala/tools/nsc/transform/LambdaLift.scala
  40. +1 −1 src/compiler/scala/tools/nsc/transform/LazyVals.scala
  41. +9 −9 src/compiler/scala/tools/nsc/transform/Mixin.scala
  42. +7 −7 src/compiler/scala/tools/nsc/transform/SampleTransform.scala
  43. +18 −18 src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
  44. +5 −5 src/compiler/scala/tools/nsc/transform/UnCurry.scala
  45. +1 −1 src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala
  46. +7 −7 src/compiler/scala/tools/nsc/typechecker/Contexts.scala
  47. +9 −9 src/compiler/scala/tools/nsc/typechecker/DeVirtualize.scala
  48. +1 −1 src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
  49. +1 −1 src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala
  50. +7 −7 src/compiler/scala/tools/nsc/typechecker/Implicits.scala
  51. +20 −20 src/compiler/scala/tools/nsc/typechecker/Infer.scala
  52. +6 −6 src/compiler/scala/tools/nsc/typechecker/Namers.scala
  53. +5 −5 src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
  54. +6 −6 src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
  55. +2 −2 src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
  56. +26 −26 src/compiler/scala/tools/nsc/typechecker/Typers.scala
  57. +7 −7 src/compiler/scala/tools/nsc/typechecker/Variances.scala
  58. +4 −4 src/compiler/scala/tools/nsc/util/DocStrings.scala
  59. +2 −2 src/compiler/scala/tools/nsc/util/Position.scala
  60. +1 −1 src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala
  61. +1 −1 src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala
  62. +14 −14 src/library/scala/Array.scala
  63. +3 −2 src/library/scala/DelayedInit.scala
  64. +35 −35 src/library/scala/Math.scala
  65. +7 −6 src/library/scala/collection/IterableLike.scala
  66. +38 −35 src/library/scala/collection/Iterator.scala
  67. +1 −1 src/library/scala/collection/MapLike.scala
  68. +2 −2 src/library/scala/collection/SeqLike.scala
  69. +7 −9 src/library/scala/collection/TraversableOnce.scala
  70. +1 −1 src/library/scala/collection/TraversableView.scala
  71. +1 −1 src/library/scala/collection/generic/GenericCompanion.scala
  72. +21 −21 src/library/scala/collection/immutable/List.scala
  73. +1 −1 src/library/scala/collection/immutable/Map.scala
  74. +13 −13 src/library/scala/collection/immutable/PagedSeq.scala
  75. +4 −4 src/library/scala/collection/immutable/RedBlack.scala
  76. +1 −1 src/library/scala/collection/immutable/Set.scala
  77. +3 −3 src/library/scala/collection/immutable/Stream.scala
  78. +2 −2 src/library/scala/collection/immutable/StringLike.scala
  79. +4 −4 src/library/scala/collection/mutable/BufferLike.scala
  80. +1 −1 src/library/scala/collection/mutable/BufferProxy.scala
  81. +1 −1 src/library/scala/collection/mutable/ImmutableMapAdaptor.scala
  82. +1 −1 src/library/scala/collection/mutable/ImmutableSetAdaptor.scala
  83. +1 −1 src/library/scala/collection/mutable/IndexedSeqView.scala
  84. +1 −1 src/library/scala/collection/mutable/MapLike.scala
  85. +1 −1 src/library/scala/collection/mutable/MutableList.scala
  86. +4 −4 src/library/scala/collection/mutable/PriorityQueue.scala
  87. +2 −2 src/library/scala/collection/mutable/Publisher.scala
  88. +3 −3 src/library/scala/collection/mutable/StringBuilder.scala
  89. +2 −2 src/library/scala/concurrent/ops.scala
  90. +1 −1 src/library/scala/math/BigInt.scala
  91. +9 −9 src/library/scala/reflect/ClassManifest.scala
  92. +7 −7 src/library/scala/reflect/Manifest.scala
  93. +3 −3 src/library/scala/reflect/generic/Flags.scala
  94. +1 −1 src/library/scala/reflect/generic/PickleFormat.scala
  95. +1 −1 src/library/scala/reflect/generic/StdNames.scala
  96. +1 −1 src/library/scala/reflect/generic/Symbols.scala
  97. +1 −1 src/library/scala/reflect/generic/Trees.scala
  98. +1 −1 src/library/scala/reflect/generic/Types.scala
  99. +2 −2 src/library/scala/reflect/generic/UnPickler.scala
  100. +1 −1 src/library/scala/util/control/Breaks.scala
  101. +1 −1 src/library/scala/util/matching/Regex.scala
  102. +40 −40 src/library/scala/util/parsing/ast/Binders.scala
  103. +7 −7 src/library/scala/util/parsing/combinator/ImplicitConversions.scala
  104. +160 −172 src/library/scala/util/parsing/combinator/Parsers.scala
  105. +8 −8 src/library/scala/util/parsing/combinator/RegexParsers.scala
  106. +1 −1 src/library/scala/util/parsing/combinator/lexical/Lexical.scala
  107. +2 −2 src/library/scala/util/parsing/combinator/lexical/Scanners.scala
  108. +5 −5 src/library/scala/util/parsing/combinator/lexical/StdLexical.scala
  109. +1 −1 src/library/scala/util/parsing/combinator/syntactical/StandardTokenParsers.scala
  110. +2 −2 src/library/scala/util/parsing/combinator/syntactical/StdTokenParsers.scala
  111. +1 −1 src/library/scala/util/parsing/combinator/syntactical/TokenParsers.scala
  112. +2 −2 src/library/scala/util/parsing/combinator/testing/Tester.scala
  113. +1 −1 src/library/scala/util/parsing/combinator/token/StdTokens.scala
  114. +2 −2 src/library/scala/util/parsing/combinator/token/Tokens.scala
  115. +3 −3 src/library/scala/util/parsing/input/CharArrayReader.scala
  116. +7 −7 src/library/scala/util/parsing/input/OffsetPosition.scala
  117. +9 −9 src/library/scala/util/parsing/input/Position.scala
  118. +1 −1 src/library/scala/util/parsing/input/Positional.scala
  119. +1 −1 src/library/scala/util/parsing/input/StreamReader.scala
  120. +1 −1 src/msil/ch/epfl/lamp/compiler/msil/emit/ILPrinterVisitor.scala
  121. +1 −1 src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSig.scala
View
@@ -238,7 +238,7 @@ class Function(val i: Int) extends Group("Function") with Arity {
curryComment +
" def curried: %s => R = {\n %s\n }\n".format(
targs mkString " => ", body
- ) + """ @deprecated("Use 'curried' instead", "2.8.0")""" + "\n def curry = curried\n"
+ ) + """ @deprecated("Use `curried` instead", "2.8.0")""" + "\n def curry = curried\n"
}
override def moreMethods = curryMethod + tupleMethod
@@ -13,8 +13,8 @@ import util.Statistics._
/** A base type sequence (BaseTypeSeq) is an ordered sequence spanning all the base types
* of a type. It characterized by the following two laws:
*
- * (1) Each element of `tp.baseTypeSeq' is a basetype of `tp'
- * (2) For each basetype `bt1' of `tp' there is an element `bt' in `tp.baseTypeSeq' such that
+ * (1) Each element of `tp.baseTypeSeq` is a basetype of `tp`
+ * (2) For each basetype `bt1` of `tp` there is an element `bt` in `tp.baseTypeSeq` such that
*
* bt.typeSymbol = bt1.typeSymbol
* bt <: bt1
@@ -96,16 +96,16 @@ trait BaseTypeSeqs {
new BaseTypeSeq(parents, arr)
}
- /** Compute new base type sequence with `tp' prepended to this sequence */
+ /** Compute new base type sequence with `tp` prepended to this sequence */
def prepend(tp: Type): BaseTypeSeq = copy(tp, 1)
- /** Compute new base type sequence with `tp' replacing the head of this sequence */
+ /** Compute new base type sequence with `tp` replacing the head of this sequence */
def updateHead(tp: Type): BaseTypeSeq = copy(tp, 0)
/** Compute new base type sequence where every element is mapped
- * with function `f'. Lazy types are mapped but not evaluated */
+ * with function `f`. Lazy types are mapped but not evaluated */
def map(f: Type => Type): BaseTypeSeq = {
- // inlined `elems map f' for performance
+ // inlined `elems map f` for performance
val len = length
var arr = new Array[Type](len)
var i = 0
@@ -139,7 +139,7 @@ trait BaseTypeSeqs {
d
}
- /** The maximum depth of type `tp' */
+ /** The maximum depth of type `tp` */
protected def maxDpth(tp: Type): Int = tp match {
case TypeRef(pre, sym, args) =>
max(maxDpth(pre), maxDpth(args) + 1)
@@ -159,7 +159,7 @@ trait BaseTypeSeqs {
1
}
- /** The maximum depth of all types `tps' */
+ /** The maximum depth of all types `tps` */
private def maxDpth(tps: Seq[Type]): Int = {
var d = 0
for (tp <- tps) d = max(d, maxDpth(tp))
@@ -94,13 +94,13 @@ trait NameManglers {
name.endChar == '=' && name.startChar != '=' && isOperatorPart(name.startChar)
}
- /** The expanded setter name of `name' relative to this class `base`
+ /** The expanded setter name of `name` relative to this class `base`
*/
def expandedSetterName(name: TermName, base: Symbol): TermName =
expandedName(name, base, separator = TRAIT_SETTER_SEPARATOR_STRING)
- /** If `name' is an expandedName name, the original name.
- * Otherwise `name' itself.
+ /** If `name` is an expandedName name, the original name.
+ * Otherwise `name` itself.
*/
def originalName(name: Name): Name = {
var i = name.length
@@ -25,21 +25,17 @@ trait Names /*extends reflect.generic.Names*/ {
final val nameDebug = false
- /** memory to store all names sequentially
- */
+ /** Memory to store all names sequentially. */
var chrs: Array[Char] = new Array[Char](NAME_SIZE)
private var nc = 0
- /** hashtable for finding term names quickly
- */
+ /** Hashtable for finding term names quickly. */
private val termHashtable = new Array[TermName](HASH_SIZE)
- /** hashtable for finding type names quickly
- */
+ /** Hashtable for finding type names quickly. */
private val typeHashtable = new Array[TypeName](HASH_SIZE)
- /** the hashcode of a name
- */
+ /** The hashcode of a name. */
private def hashValue(cs: Array[Char], offset: Int, len: Int): Int =
if (len > 0)
(len * (41 * 41 * 41) +
@@ -58,8 +54,7 @@ trait Names /*extends reflect.generic.Names*/ {
i == len
}
- /** enter characters into chrs array
- */
+ /** Enter characters into chrs array. */
private def enterChars(cs: Array[Char], offset: Int, len: Int) {
var i = 0
while (i < len) {
@@ -75,8 +70,7 @@ trait Names /*extends reflect.generic.Names*/ {
else nc = nc + len
}
- /** Create a term name from the characters in cs[offset..offset+len-1].
- */
+ /** Create a term name from the characters in cs[offset..offset+len-1]. */
def newTermName(cs: Array[Char], offset: Int, len: Int): TermName = {
val h = hashValue(cs, offset, len) & HASH_MASK
var n = termHashtable(h)
@@ -89,30 +83,25 @@ trait Names /*extends reflect.generic.Names*/ {
n
}
- /** create a term name from string
- */
+ /** Create a term name from string. */
def newTermName(s: String): TermName =
newTermName(s.toCharArray(), 0, s.length())
- /** Create a term name from the UTF8 encoded bytes in bs[offset..offset+len-1].
- */
+ /** Create a term name from the UTF8 encoded bytes in bs[offset..offset+len-1]. */
def newTermName(bs: Array[Byte], offset: Int, len: Int): TermName = {
val chars = Codec fromUTF8 bs.slice(offset, offset + len)
newTermName(chars, 0, chars.length)
}
- /** Create a type name from the characters in cs[offset..offset+len-1].
- */
+ /** Create a type name from the characters in cs[offset..offset+len-1]. */
def newTypeName(cs: Array[Char], offset: Int, len: Int): TypeName =
newTermName(cs, offset, len).toTypeName
- /** Create a type name from string
- */
+ /** Create a type name from string. */
def newTypeName(s: String): TypeName =
newTermName(s).toTypeName
- /** Create a type name from the UTF8 encoded bytes in bs[offset..offset+len-1].
- */
+ /** Create a type name from the UTF8 encoded bytes in bs[offset..offset+len-1]. */
def newTypeName(bs: Array[Byte], offset: Int, len: Int): TypeName =
newTermName(bs, offset, len).toTypeName
@@ -124,8 +113,7 @@ trait Names /*extends reflect.generic.Names*/ {
def nameChars: Array[Char] = chrs
@deprecated("", "2.9.0") def view(s: String): TermName = newTermName(s)
- /** An implicit conversion from names to term names
- */
+ /** An implicit conversion from names to term names. */
implicit def promoteTermNamesAsNecessary(name: Name): TermName = mkTermName(name)
@@ -136,12 +124,10 @@ trait Names /*extends reflect.generic.Names*/ {
/** Index into name table */
def start: Int = index
- /** next name in the same hash bucket
- */
+ /** The next name in the same hash bucket. */
def next: Name
- /** return the length of this name
- */
+ /** The length of this name. */
final def length: Int = len
final def isEmpty = length == 0
final def nonEmpty = !isEmpty
@@ -153,26 +139,23 @@ trait Names /*extends reflect.generic.Names*/ {
def companionName: Name
def bothNames: List[Name] = List(toTermName, toTypeName)
- /** Copy bytes of this name to buffer cs, starting at position `offset`.
- */
+ /** Copy bytes of this name to buffer cs, starting at position `offset`. */
final def copyChars(cs: Array[Char], offset: Int) =
compat.Platform.arraycopy(chrs, index, cs, offset, len)
- /** return the ascii representation of this name
- */
+ /** @return the ascii representation of this name */
final def toChars: Array[Char] = {
val cs = new Array[Char](len)
copyChars(cs, 0)
cs
}
- /** return the string representation of this name
- */
+ /** @return the string representation of this name */
final override def toString(): String = new String(chrs, index, len)
def debugString() = NameTransformer.decode(toString) + (if (isTypeName) "!" else "")
/** Write to UTF8 representation of this name to given character array.
- * Start copying to index `to'. Return index of next free byte in array.
+ * Start copying to index `to`. Return index of next free byte in array.
* Array must have enough remaining space for all bytes
* (i.e. maximally 3*length bytes).
*/
@@ -182,8 +165,7 @@ trait Names /*extends reflect.generic.Names*/ {
offset + bytes.length
}
- /** return the hash value of this name
- */
+ /** @return the hash value of this name */
final override def hashCode(): Int = index
// Presently disabled.
@@ -209,17 +191,16 @@ trait Names /*extends reflect.generic.Names*/ {
false
}
- /** return the i'th Char of this name
- */
+ /** @return the i'th Char of this name */
final def apply(i: Int): Char = chrs(index + i)
- /** return the index of first occurrence of char c in this name, length if not found */
+ /** @return the index of first occurrence of char c in this name, length if not found */
final def pos(c: Char): Int = pos(c, 0)
- /** return the index of first occurrence of char c in this name, length if not found */
+ /** @return the index of first occurrence of char c in this name, length if not found */
final def pos(s: String): Int = pos(s, 0)
- /** return the index of the first occurrence of character c in
+ /** Returns the index of the first occurrence of character c in
* this name from start, length if not found.
*
* @param c the character
@@ -232,7 +213,7 @@ trait Names /*extends reflect.generic.Names*/ {
i
}
- /** return the index of the first occurrence of nonempty string s
+ /** Returns the index of the first occurrence of nonempty string s
* in this name from start, length if not found.
*
* @param s the string
@@ -252,7 +233,7 @@ trait Names /*extends reflect.generic.Names*/ {
len
}
- /** return the index of last occurrence of char c in this
+ /** Returns the index of last occurrence of char c in this
* name, -1 if not found.
*
* @param c the character
@@ -262,7 +243,7 @@ trait Names /*extends reflect.generic.Names*/ {
final def lastPos(s: String): Int = lastPos(s, len - s.length)
- /** return the index of the last occurrence of char c in this
+ /** Returns the index of the last occurrence of char c in this
* name from start, -1 if not found.
*
* @param c the character
@@ -275,7 +256,7 @@ trait Names /*extends reflect.generic.Names*/ {
i
}
- /** return the index of the last occurrence of string s in this
+ /** Returns the index of the last occurrence of string s in this
* name from start, -1 if not found.
*
* @param s the string
@@ -295,12 +276,10 @@ trait Names /*extends reflect.generic.Names*/ {
-s.length()
}
- /** does this name start with prefix?
- */
+ /** Does this name start with prefix? */
final def startsWith(prefix: Name): Boolean = startsWith(prefix, 0)
- /** does this name start with prefix at given start index?
- */
+ /** Does this name start with prefix at given start index? */
final def startsWith(prefix: Name, start: Int): Boolean = {
var i = 0
while (i < prefix.length && start + i < len &&
@@ -309,12 +288,10 @@ trait Names /*extends reflect.generic.Names*/ {
i == prefix.length
}
- /** does this name end with suffix?
- */
+ /** Does this name end with suffix? */
final def endsWith(suffix: Name): Boolean = endsWith(suffix, len)
- /** does this name end with suffix just before given end index?
- */
+ /** Does this name end with suffix just before given end index? */
final def endsWith(suffix: Name, end: Int): Boolean = {
var i = 1
while (i <= suffix.length && i <= end &&
@@ -347,8 +324,7 @@ trait Names /*extends reflect.generic.Names*/ {
def lastIndexOf(ch: Char) = toChars lastIndexOf ch
- /** Return the subname with characters from start to end-1.
- */
+ /** Return the subname with characters from start to end-1. */
def subName(from: Int, to: Int): Name
/** Replace all occurrences of `from` by `to` in
@@ -365,8 +341,7 @@ trait Names /*extends reflect.generic.Names*/ {
newTermName(cs, 0, len)
}
- /** Replace operator symbols by corresponding $op_name.
- */
+ /** Replace operator symbols by corresponding $op_name. */
def encode: Name = {
val str = toString()
val res = NameTransformer.encode(str)
@@ -378,8 +353,7 @@ trait Names /*extends reflect.generic.Names*/ {
def append(suffix: String): Name
def append(suffix: Name): Name
- /** Replace $op_name by corresponding operator symbol.
- */
+ /** Replace $op_name by corresponding operator symbol. */
def decode: String = (
NameTransformer.decode(toString()) +
(if (nameDebug && isTypeName) "!" else ""))//debug
Oops, something went wrong.

0 comments on commit 60c8697

Please sign in to comment.