summaryrefslogtreecommitdiff
path: root/test/files
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | Repairs unexpected failure of test t6200.scalaRex Kerr2014-01-151-3/+3
| |/ / / / / |/| | | | | | | | | | | | | | | | | Added extra ()'s to get rid of deprecation warning for inferring unit arg.
* | | | | | Merge pull request #3318 from rklaehn/issue/6196Ichoran2014-01-152-0/+136
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6196 - Set should implement filter
| * | | | | | SI-6200 - HashMap should implement filterRüdiger Klaehn2014-01-151-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the exact same algorithm as in SI-6196, with only slight differences due to the two type arguments of HashMap. Filter is tested by the new comparative collection test by @Ichoran, but there is nevertheless a small correctness test in t6200 in addition to tests of the new desirable behavior.
| * | | | | | SI-6196 - Set should implement filterRüdiger Klaehn2014-01-151-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements a version of filter and filterNot that reuses as much as possible from the existing tree instead of building an entirely new one like the builder-based filter does. This results in significant performance improvements on average. Adds a test of basic correctness of filter and filterNot as well as of the desirable properties of the new filter implementation. This is a collaboration between me and @Ichoran
* | | | | | | Merge pull request #3316 from Ichoran/topic/big-decimal-correctnessAdriaan Moors2014-01-154-19/+39
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Quasi-comprehensive BigDecimal soundness/correctness fix.
| * | | | | | | Quasi-comprehensive BigDecimal soundness/correctness fix.Rex Kerr2014-01-144-19/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes issues SI-6153, SI-6173, SI-6456, SI-6699, and SI-8116, along with a number of other similar possible issues. Relevant changes include * Changes to avoid heap explosion when working with BigInt - to isWhole - to hashCode - to equals - to BigInt's equals * Changes to enable equality matching hashCode - Only for sufficiently small BigInt - For identical values with different precision * Changes to isValidDouble - Takes precision into account now - New methods added to test whether even if the Double is not represented exactly, it's a representation of a certain type - New companion methods added to allow intended expansion of Double (binary/decimal difference) * Changes to constructor - Null arguments are not allowed (these can throw NPEs later at awkward/unexpected times) * New JUnit test to test all these things * Fixed existing tests to expect new behavior * Modified scaladocs to explain the issues * Deprecated problematic methods * Made application of MathContext more consistent (it is where you expect it and not where you don't) These changes are coordinated, for the most part, hence the monolithic commit.
* | | | | | | | Merge pull request #3304 from non/bug/stream-flatten2-8100Adriaan Moors2014-01-152-0/+9
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-8100 - prevent possible SOE during Stream#flatten.
| * | | | | | | | SI-8100 - prevent possible SOE during Stream#flatten.Erik Osheim2013-12-242-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | | Merge pull request #3293 from soc/SI-7469Adriaan Moors2014-01-152-2/+2
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Remove misc. @deprecated elements
| * | | | | | | | | SI-7469 Remove misc. @deprecated elementsSimon Ochsenreither2014-01-092-2/+2
| | | | | | | | | |
* | | | | | | | | | Merge pull request #3285 from som-snytt/issue/8015-FF-NLsAdriaan Moors2014-01-156-0/+39
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Count lines by EOLs
| * | | | | | | | | | SI-8015 Unprintables in messagesSom Snytt2014-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | | | | | SI-8015 Count lines by EOLsSom Snytt2014-01-086-0/+39
| |/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | | | Merge pull request #3260 from soc/SI-8035Adriaan Moors2014-01-1521-165/+217
|\ \ \ \ \ \ \ \ \ \ | |_|_|_|/ / / / / / |/| | | | | | | | | Deprecate automatic () insertion in argument lists
| * | | | | | | | | SI-8035 Deprecate automatic () insertion in argument listsSimon Ochsenreither2014-01-0921-165/+217
| |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | | Merge pull request #3321 from VladimirNik/sprinterJason Zaugg2014-01-151-2/+2
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Add tree-based code generation
| * | | | | | | | | Variance annotations printingVladimirNik2014-01-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | def printTypeParams is modified. Tests are updated.
* | | | | | | | | | Merge pull request #3369 from retronym/ticket/8132Grzegorz Kossakowski2014-01-151-0/+5
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-8132 Fix false "overrides nothing" for case class protected param
| * | | | | | | | | | SI-8132 Fix false "overrides nothing" for case class protected paramJason Zaugg2014-01-151-0/+5
| | |_|_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | | | Merge pull request #3315 from rklaehn/issue/7326Ichoran2014-01-151-0/+64
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Implements specialized subsetOf for HashSet
| * | | | | | | | | | Implements specialized subsetOf for HashSetRüdiger Klaehn2014-01-141-0/+64
| | |_|_|/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes SI-7326. This also adds a basic test for subsetOf that was missing before.
* | | | | | | | | | Merge pull request #3363 from retronym/ticket/8146Jason Zaugg2014-01-156-0/+119
|\ \ \ \ \ \ \ \ \ \ | |_|_|_|_|/ / / / / |/| | | | | | | | | Fix non-deterministic <:< for deeply nested types
| * | | | | | | | | SI-8146 Fix non-deterministic <:< for deeply nested typesJason Zaugg2014-01-142-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | | | | | SI-8146 Test cases for typechecking decidabilityJason Zaugg2014-01-144-0/+33
| | |/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | | Merge pull request #3355 from xeno-by/topic/saturday-nightJason Zaugg2014-01-14245-673/+680
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | reshuffles names for blackbox/whitebox contexts, changes bundle notation
| * | | | | | | | | prohibits constructor overloading for macro bundlesEugene Burmako2014-01-123-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | | | | changes bundles to be classes, not traits extending MacroEugene Burmako2014-01-1225-89/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | | | | *boxContext => *box.Context , *boxMacro => *box.MacroEugene Burmako2014-01-12235-620/+622
| |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | | | | Merge pull request #3275 from paulp/pr/patmatAdriaan Moors2014-01-1318-47/+339
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Improves name-based patmat.
| * | | | | | | | | SI-8128 Fix regression in extractors returning existentialsJason Zaugg2014-01-091-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | | | | SI-8045 type inference of extracted valuePaul Phillips2013-12-231-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test case for SI-8045, fixed by the preceding commits.
| * | | | | | | | | SI-7850 CCE in patmat with invalid isEmpty.Paul Phillips2013-12-154-9/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | | | | SI-7897, SI-6675 improves name-based patmatPaul Phillips2013-12-1513-38/+275
| | |_|_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | | Merge pull request #3242 from retronym/ticket/8046Adriaan Moors2014-01-136-0/+88
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-8046 BaseTypeSeq fixes with aliases
| * | | | | | | | | SI-8046 Only use fast TypeRef#baseTypeSeq with concrete base typesJason Zaugg2013-12-104-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can only compute the base type sequence (BTS) of a `TypeRef` by element-wise transforming the BTS of the referenced symbol if there are no abstract types in its BTS type symbols. In the now-working test case, `pos/t8046.scala`, the difference between the old and new calculation of the BTS is: this = Three.this.Alias[Int] sym.info.baseTypeSeq = BTS(One.this.Op[A],Any) mapped BTS = BTS(Three.this.Op[Int],Any) full BTS = BTS(Three.this.Op[Int],Int => Int,Object,Any) The change to account for PolyType in ArgsTypeRef#transform is now needed to avoid the full BTS of: BTS(Three.this.Op[A],A => A,Object,Any) Interestingly, everything actually works without that change.
| * | | | | | | | | SI-8046 Fix baseTypeSeq in presence of type aliasesJason Zaugg2013-12-092-0/+36
| | | | | | | | | |
* | | | | | | | | | Merge pull request #3184 from retronym/ticket/2066Adriaan Moors2014-01-135-0/+137
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-2066 Plug a soundness hole higher order type params, overriding
| * | | | | | | | | | SI-2066 Plug a soundness hole higher order type params, overridingJason Zaugg2013-11-275-0/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PolyType-s parameterized by higher order type parameters (HOTPs) should only be relatable with <:< or =:= if the variances of their type parameters line up. This is only enforced for HOTPs defined in method type arguments. Invariant type parameters subsume variant ones. Concretely, as described by @S11001001: > A method taking [F[_]] can implement a method taking [F[+_]]. > Likewise, a method taking [F[_[+_]]] can implement a method > taking [F[_[_]]], as with [F[_[_[_]]]] implementing [F[_[_[+_]]]], > and so on, the variance subsumption flipping at each step. > > This is just the opposite of the variance for passing type > parameters to either instantiate types or call methods; a F[+_] > is a suitable F[_]-argument, a F[_[_]] a suitable F[_[+_]]-argument, > and so on. > > All of the above rules can be duplicated for contravariant positions > by substituting - for +. Also, something similar happens for > weakening/strengthening bounds, I believe. These cases are tested in the `// okay` lines in `neg/t2066.scala`.
* | | | | | | | | | | Merge pull request #3351 from xeno-by/topic/fix-platform-dependent-testJason Zaugg2014-01-101-3/+4
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | fixes run/macroPlugins-namerHooks.scala
| * | | | | | | | | | | fixes run/macroPlugins-namerHooks.scalaEugene Burmako2014-01-101-3/+4
| | |_|_|/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes run/macroPlugins-namerHooks.scala work equally well on both Unix and Windows machines.
* | | | | | | | | | | Merge pull request #3350 from retronym/ticket/8131Jason Zaugg2014-01-101-32/+0
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | SI-8131 Move test for reflection thread safety to pending.
| * | | | | | | | | | | SI-8131 Move test for reflection thread safety to pending.Jason Zaugg2014-01-101-32/+0
| |/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Examples noted in SI-8131 show that race conditions still abound. This has been noted twice during pull request validation.
* | | | | | | | | | | SI-8135 Disabled flaky hyperlinking presentation compiler testMirco Dotta2014-01-103-67/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR (https://github.com/scala/scala/pull/3275#issuecomment-31986434) demonstrates that the test is flaky. The disabled test was introduced with the intent of preventing a regression (here is the commit https://github.com/scala/scala/commit/ccacb06c4928fd6aebc2c2539d7565cb079dc625). It looks like there is a race condition when `askTypeAt(pos)` is called on `implicitly[Foo[A]].foo` where `pos` is matches the end point of the former expression. The issue is that the returned Tree is unattributed, which is why the error "No symbol is associated with tree implicitly[Foo[A]].foo" is reported.
* | | | | | | | | | | Merge pull request #3124 from DarkDimius/fix-7443Adriaan Moors2014-01-091-0/+41
|\ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / |/| | | | | | | | | | Fix SI-7443 Range.sum ignoring Numeric argument and always assuming default 'plus' implementation
| * | | | | | | | | | SI-7443 Use typeclass instance for {Range,NumericRange}.sumDmitry Petrashko2013-12-291-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously both Range and NumeriRange used formula for sum of elements of arithmetic series and thus always assumed that provided Numeric is regular one. Bug is now fixed by conservatively checking if Numeric is one of default ones and the formula still holds.
* | | | | | | | | | | Merge pull request #3342 from xeno-by/topic/pres-compiler-macrosJason Zaugg2014-01-099-0/+67
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Presentation compiler friendliness for macros
| * | | | | | | | | | | Use macro expandee, rather than expansion, in pres. compilerJason Zaugg2014-01-082-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The presentation compiler is primarily interested in trees that represent the code that one sees in the IDE, not the expansion of macros. This commit continues to expand macros, but adds a hook in which the presentation compiler discards the expansion, retaining instead the expandee. The expandee is attributed with the type of the expansion, which allows white box macros to work. In addition, any domain specific errors and warnings issued by the macro will still be reported, as a side-effect of the expansion. The failing test from the last commit now correctly resolves hyperlinks in macro arguments. Related IDE ticket: https://www.assembla.com/spaces/scala-ide/tickets/1001449# This facility is configured as follows: // expand macros as per normal -Ymacro-expand:normal // don't expand the macro, takes the place of -Ymacro-no-expand -Ymacro-expand:none // expand macros to compute type and emit warnings, // but retain expandee. Set automatically be the presentation // compiler -Ymacro-expand:discard This leaves to door ajar for a new option: // Don't expand blackbox macros; expand whitebox // but retain expandee -Ymacro-expand:discard-whitebox-only The existing test for SI-6812 has been duplicated. One copy exercises the now-deprecated -Ymacro-no-expand, and the other uses the new option.
| * | | | | | | | | | | SI-8064 Automatic position repair for macro expansionJason Zaugg2014-01-086-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replace NoPosition with the focus of the macro application - Focus all range positions, for example, those of spliced arguments
| * | | | | | | | | | | Test to show the bug with hyperlinking in macro argumentsJason Zaugg2014-01-083-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the presentation compiler sees the expansion of macros; this no longer contains the trees corresponding to the macro arguments, and hyperlink requests result incorrect results. https://www.assembla.com/spaces/scala-ide/tickets/1001449#
* | | | | | | | | | | | Merge pull request #3332 from xeno-by/topic/existential-type-treeJason Zaugg2014-01-091-1/+1
|\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | ExistentialTypeTree.whereClauses are now MemberDefs