| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
SI-8100 - prevent possible SOE during Stream#flatten.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit changes stream flatten to avoid allocating a
stack frame for every stream item. Previously, flattening
a stream whose elements are mostly empty would result in
a StackOverflowException.
This commit also adds a test demonstrating the problem.
|
|\ \
| | |
| | | |
Remove misc. @deprecated elements
|
| | | |
|
|\ \ \
| | | |
| | | | |
Count lines by EOLs
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Make an obscure private def local and rename it usefully.
If you really must have similar functions in the API
(to detect line breaks and EOL), at least make them DRY.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Just a diamond in the rough.
Wikipedia warns against confusing it with "carrot."
The first word should really be pronounced as the garage phrase,
"Where's the car at?" and the second like "beret."
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The line content to display should include the whole line,
inclusive of embedded line breaks, and any control chars
should be displayed in unicode escape.
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Source lines were counted by "line break chars", including FF.
Clients of `pos.line` seem to all expect the ordinary line num,
so that is what they get.
Unicode processing now precedes line ending processing.
|
|\ \ \
| | | |
| | | | |
Deprecate automatic () insertion in argument lists
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This promotes the () insertion warning from -Ywarn-adapted-args to a
deprecation warning. -Xfuture tunrs it into a compiler error.
Auto tupling remains unchanged for now.
The tests have been fixed the following way:
- Warnings caused by general sloppiness (Try(), Future(), ...) have been
fixed.
- Warnings which raise interesting questions (x == (), ...) received an
updated checkfile for now.
|
|\ \ \
| | | |
| | | | |
SI-8107: Add Regex.quote
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
SI-8081 unzip/unzip3 return wrong static type when applied to Arrays
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Added unzip and unzip3 methods to ArrayOps so that we get proper return
values. (No tests due to unfavorable effort/reward ratio for an ongoing
test of something so simple.)
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Add tree-based code generation
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
1. Problem with multiple parameter lists in annotations is resolved
2. Tests for Annotated trees are added
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
1. Printers API is updated (def toCode)
2. ParsedTreePrinter is added to internal.Printers. ParsedTreePrinter generates the code for passed unattributed trees.
Generated code can be later compiled by scalac retaining the same meaning.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
val showOuterTests wasn't used in Printers
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
def printTypeParams is modified. Tests are updated.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-8132 Fix false "overrides nothing" for case class protected param
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Case class parameters that are less-than-public have an accessor
method created. In the enclosed test, we saw:
case class G extends AnyRef with T with Product with Serializable {
override <synthetic> <stable> <caseaccessor> def s$1: String = G.this.s;
<caseaccessor> <paramaccessor> private[this] val s: String = _;
override <stable> <accessor> <paramaccessor> protected def s: String = G.this.s;
...
}
This commit removes the OVERRIDE flag from the accessor method,
which avoids the spurious "overrides nothing" error.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Implements specialized subsetOf for HashSet
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Added some more general documentation about how levels work and how the
bitmap field encodes the position of elems.
|
| | |_|_|_|_|/
| |/| | | | |
| | | | | | |
| | | | | | | |
Fixes SI-7326. This also adds a basic test for subsetOf that was missing before.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Fix non-deterministic <:< for deeply nested types
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
In the interests of keeping subtyping decidable [1], 152563b
added some bookkeeping to `isSubType` to detect cycles.
However, this was based on a hash set containing instances of
`SubTypePair`, and that class had inconsistencies between its
`hashCode` (in terms of `Type#hashCode`) and `equals`
(in terms of `=:=`).
This inconsistency can be seen in:
scala> trait C { def apply: (Int @unchecked) }
defined trait C
scala> val intUnchecked = typeOf[C].decls.head.info.finalResultType
intUnchecked: $r.intp.global.Type = Int @unchecked
scala> val p1 = new SubTypePair(intUnchecked, intUnchecked)
p1: $r.intp.global.SubTypePair = Int @unchecked <:<? Int @unchecked
scala> val p2 = new SubTypePair(intUnchecked.withoutAnnotations, intUnchecked.withoutAnnotations)
p2: $r.intp.global.SubTypePair = Int <:<? Int
scala> p1 == p2
res0: Boolean = true
scala> p1.hashCode == p2.hashCode
res1: Boolean = false
This commit switches to using `Type#==`, by way of the standard
case class equality.
The risk here is that you could find a subtyping computation that
progresses in such a manner that we don't detect the cycle. It would
need to produce an infinite stream of representations for types that
were `=:=` but not `==`. If that happened, we'd fail to terminate,
rather than judging the relationship as `false`.
[1] http://research.microsoft.com/pubs/64041/fool2007.pdf
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Taken from "On Decidability of Nominal Subtyping with Variance"
(Pierce, Kennedy), which was implemented in 152563b.
Part of the implementation (SubTypePair) will be changed in the
following commit to fix the non-deterministic errors typechecking
heavily nested types involving aliases or annotations.
|
| | |/ / / / /
| |/| | | | | |
|
|\ \ \ \ \ \ \
| |_|_|_|/ / /
|/| | | | | | |
Removes TODO comments that are no longer applicable
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
- we do not want to use mutable updates because that would mean making vals
vars, losing various guarantees for final fields of the java memory model
- we do not want to add more subcasses of HashSet, because that would make
callsites megamorphic. If anything, we should try to reduce the number of
subclasses
- checking for monomorphic call site is not worth it for a single virtual
method call.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
reshuffles names for blackbox/whitebox contexts, changes bundle notation
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This code is currently unused, so I’m removing it in order to avoid bitrot.
Once we’re sure that we can trust Scala reflection with our macros, the
removed file can be easily reinstated.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
As per Jason’s feedback, this commit handles overloaded constructors
in macro bundles. The backend now checks that we have a constructor of
a correct type. The frontend now prohibits multiple constructors altogether.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Adjusts bundle notation to read `class Bundle(val c: Context)` instead of
`class Bundle extends Macro`. This avoids calling compileLate in the
macro compiler and associated tooling problems.
|
| | |/ / / / /
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Performs the following renamings:
* scala.reflect.macros.BlackboxContext to scala.reflect.macros.blackbox.Context
* scala.reflect.macros.BlackboxMacro to scala.reflect.macros.blackbox.Macro
* scala.reflect.macros.WhiteboxContext to scala.reflect.macros.whitebox.Context
* scala.reflect.macros.WhiteboxMacro to scala.reflect.macros.whitebox.Macro
https://groups.google.com/forum/#!topic/scala-internals/MX40-dM28rk
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Improves name-based patmat.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
I discovered on erroneous code it could fall into a loop looking
for product selectors, because ErrorType always claims to have
whatever member you're asking about.
|
| |\ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-8128 Fix regression in extractors returning existentials
|
| |/ / / / / / /
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
The advent of the named based pattern matcher brought with it
a change in the way we determine the type of the value in the
"match monad". We used to take the base type to `Option` or `Seq`
(guided by the method name in `unapply` vs `unapplySeq`), and
simply use the type argument.
Name-based patmat, instead, uses the result type of methods in the
type. For example, the element type of an Option-like extractor
result is given by the result type of the no-args `get` method.
This approach, however, swiftly runs aground when navigating the
existential atolls. Here's why:
scala> class F[_]
defined class F
scala> val tp = typeOf[Some[F[X]] forSome { type X }]
warning: there were 1 feature warning(s); re-run with -feature for details
tp: $r.intp.global.Type = scala.this.Some[F[X]] forSome { type X }
scala> tp.baseType(typeOf[Option[_]].typeSymbol).typeArgs.head
res10: $r.intp.global.Type = F[X] forSome { type X }
scala> tp.memberType(tp.member(nme.get)).finalResultType
res11: $r.intp.global.Type = F[X]
`res10` corresponds to 2.10.x approach in `matchMonadResult`.
`res11` corresponds to the new approach in `resultOfMatchingMethod`.
The last result is not wrapped by the existential type. This results
in errors like (shown under -Ydebug to turn un accurate printing of
skolems):
error: error during expansion of this match (this is a scalac bug).
The underlying error was: type mismatch;
found : _$1&0 where type _$1&0
required: _$1
(0: Any) match {
^
one error found
This commit addresses the regression in 2.10.x compatible extractors
by using the 2.10 approach for them.
The residual problem is shown in the enclosed pending test.
|
| | | | | | | | |
|
| | | | | | | | |
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Test case for SI-8045, fixed by the preceding commits.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Name-based pattern matcher needed some hardening against
unapply methods with the right name but wrong types. Only
isEmpty methods which return Boolean are acceptable.
Catching it directly rather than indirectly also allowed
for better error messages.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This emerges from a recent attempt to eliminate pattern matcher
related duplication and to bake the scalac-independent logic
out of it. I had in mind something a lot cleaner, but it was
a whole lot of work to get it here and I can take it no further.
Key file to admire is PatternExpander.scala, which should
provide a basis for some separation of concerns.
The bugs addressed are a CCE involving Tuple1 and an imprecise
warning regarding multiple pattern crushing.
Editorial: auto-tupling unapply results was a terrible idea which
should never have escaped from the crib. It is tantamount to
purposely throwing type safety down the toilet in the very place
where people need type safety the most. See SI-6111 and SI-6675 for
some other comments.
|