summaryrefslogtreecommitdiff
path: root/test/files/neg
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3197 from retronym/merge/2.10.x-positions-to-masterJason Zaugg2013-11-261-4/+4
|\ | | | | Merge 2.10.x, and PR #3196, to master
| * Merge remote-tracking branch 'origin/pr/3196' into ↵Jason Zaugg2013-11-261-4/+4
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge/2.10.x-positions-to-master Conflicts: src/compiler/scala/tools/nsc/typechecker/Typers.scala test/files/neg/applydynamic_sip.check - Changes two calls from `.endOrPoint` to `.point`. The latter is safe in master for both `Range`- and `OffsetPosition`s - Updates checkfiles with unrelated position changes (constructors)
| | * SI-7463,SI-8003 Correct wrong position for {select,apply}Dynamic callsSimon Schaefer2013-11-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new positions are range positions that directly refer to the beginning and the end of the method calls in the sources instead of simply point to the beginning of the expression. This allows the scala-ide to semantically highlight select- and applyDynamic method calls, because it has only to traverse the tree and apply the color ranges to the given position ranges. This also fixes the position marker of an error messages related to a wrong Dynamic method signature.
| | * SI-7519: Additional test case covering sbt/sbt#914Mark Harrah2013-10-233-0/+26
| | | | | | | | | | | | (cherry picked from commit e72c32db03b44d6eaf1c1872765a578c5445e15f)
| | * [nomaster] SI-7519 Less brutal attribute resetting in adapt fallbackJason Zaugg2013-10-232-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prefers `resetLocalAttrs` over `resetAllAttrs`. The latter loses track of which enclosing class of the given name is referenced by a `This` node which prefixes the an applied implicit view. The code that `resetAllAttrs` originally landed in: https://github.com/scala/scala/commit/d4c63b#L6R804 Cherry picked from 433880e91cba9e1e926e9fcbf04ecd4aeb1d73eb Conflicts: src/compiler/scala/tools/nsc/typechecker/Typers.scala
* | | SI-7984 Issue unchecked warning for type aliasesJason Zaugg2013-11-267-9/+23
|/ / | | | | | | | | | | - Dealias pattern types before launching the CheckabilityChecker - Sharpen the error messages to explain that the dealiased type is the expansion of the alias.
* | Merge pull request #3178 from retronym/ticket/7872Adriaan Moors2013-11-257-1/+72
|\ \ | | | | | | SI-7872 Plug a variance exploit in refinement types
| * | SI-7872 Plug a variance exploit in refinement typesJason Zaugg2013-11-237-1/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refinement types are collapsed to a TypeTree with an original during type checking; this was enough to evade variance validation in refchecks. This commit: - validates the original of `TypeTree`s in refchecks - changes VarianceValidator to recurse into: - the originals of `TypeTree`s - `TypTree` (to cover, e.g. `CompoundTypeTree` / `SelectFromTypeTree`) It also finds an unreported variance violation in an existing test case, variances.scala. This looks to be legitimate.
* | | Merge pull request #3130 from retronym/ticket/7967-2Adriaan Moors2013-11-252-0/+18
|\ \ \ | | | | | | | | SI-7967 Account for type aliases in self-type checks
| * | | SI-7967 Account for type aliases in self-type checksJason Zaugg2013-11-222-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These eluded the check for "illegal inheritance; self-type does not conform" as AliasTypeRef doesn't forward `typeOfThis`. This commit dealiases before calling `typeOfThis`. That seems to be the most localised change. Without the dealias, we had: parent.tpe = TypeRef(pre, sym = AliasTypeSymbol("CC"), Nil) parent.tpe.typeOfThis = parent.tpe.transform(sym.typeOfThis) = CC After: parent.tpe.dealias = TypeRef(pre, sym = ClassSymbol("C"), Nil) parent.tpe.dealias.typeOfThis = C with B
* | | | Merge pull request #3131 from densh/pr/deprecate-pair-and-tripleJason Zaugg2013-11-227-9/+9
|\ \ \ \ | | | | | | | | | | Deprecate Pair and Triple
| * | | | deprecate Pair and TripleDen Shabalin2013-11-207-9/+9
| | |/ / | |/| |
* / | | Handle TypeApply(fun, ...) for symbol-less funsJason Zaugg2013-11-212-0/+7
|/ / / | | | | | | | | | | | | | | | Such as class literals, as one could conjure in `classOf[Int][Int]` Before, this would crash with a `NullPointerException`
* | | Merge pull request #3141 from soc/SI-7961Adriaan Moors2013-11-172-8/+14
|\ \ \ | | | | | | | | SI-7961 Fix false positive procedure warnings
| * | | SI-7961 Fix false positive procedure warningsSimon Ochsenreither2013-11-142-8/+14
| |/ / | | | | | | | | | | | | | | | | | | Two issues are fixed in this commit: - `def foo: Unit` was detected as missing a return type - The warning was emitted for constructors, but `def this(...): Unit = ...` is not valid Scala syntax
* | | Merge pull request #3129 from adriaanm/pr-rebase-3001Adriaan Moors2013-11-1371-182/+340
|\ \ \ | |/ / |/| | [rebase] blackbox and whitebox macros
| * | blackbox restriction #4: can't customize pattern matchingEugene Burmako2013-11-124-1/+31
| | | | | | | | | | | | | | | | | | When an application of a blackbox macro is used as an extractor in a pattern match, it triggers an unconditional compiler error, preventing customizations of pattern matching implemented with macros.
| * | blackbox restriction #3: can't affect implicit searchEugene Burmako2013-11-125-7/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | When an application of a blackbox macro is used as an implicit candidate, no expansion is performed until the macro is selected as the result of the implicit search. This makes it impossible to dynamically calculate availability of implicit macros.
| * | blackbox restriction #2: can't guide type inferenceEugene Burmako2013-11-124-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an application of a blackbox macro still has undetermined type parameters after Scala’s type inference algorithm has finished working, these type parameters are inferred forcedly, in exactly the same manner as type inference happens for normal methods. This makes it impossible for blackbox macros to influence type inference, prohibiting fundep materialization.
| * | blackbox restriction #1: can't refine the official return typeEugene Burmako2013-11-125-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an application of a blackbox macro expands into a tree `x`, the expansion is wrapped into a type ascription `(x: T)`, where `T` is the declared return type of the blackbox macro with type arguments and path dependencies applied in consistency with the particular macro application being expanded. This invalidates blackbox macros as an implementation vehicle of type providers.
| * | blackbox and whitebox macrosEugene Burmako2013-11-1257-181/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first commit in the series. This commit only: 1) Splits Context into BlackboxContext and WhiteboxContext 2) Splits Macro into BlackboxMacro and WhiteboxMacro 3) Introduces the isBundle property in the macro impl binding Here we just teach the compiler that macros can now be blackbox and whitebox, without actually imposing any restrictions on blackbox macros. These restrictions will come in subsequent commits. For description and documentation of the blackbox/whitebox separation see the official macro guide at the scaladoc website: http://docs.scala-lang.org/overviews/macros/blackbox-whitebox.html Some infrastructure work to make evolving macros easier: compile partest-extras with quick so they can use latest library/reflect/...
* | | Merge pull request #3123 from som-snytt/issue/7747-scrapcodes-fixAdriaan Moors2013-11-121-6/+2
|\ \ \ | | | | | | | | SI-7747 Support class based wrappers in REPL
| * | | SI-7747 Support class based wrappers clean upSom Snytt2013-11-101-6/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplified the code paths to just use one of two `Wrapper` types for textual templating. Simplified the class-based template to use the same `$iw` name for the both the class and the wrapper value. In addition, the $read value is an object extending $read, instead of containing an extra instance field, which keeps paths to values the same for both templates. Both styles trigger loading the value object by referencing the value that immediately wraps the user code, although for the class style, inner vals are eager and it would suffice to load the enclosing `$read` object. The proposed template included extra vals for values imported from history, but this is not necessary since such an import is always a stable path. (Or, counter-example to test is welcome.) The test for t5148 is updated as a side effect. Probably internal APIs don't make good test subjects. Modify -Y option message.
* / / Make parameters to implicit value classes privateJason Zaugg2013-11-121-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So that they aren't offered as an autocomplete suggestion: implicit class Shouty(string: String) extends AnyVal { def SHOUT_! = string.toUpperCase + "!" } "". // autocompletion offers `.string` here The original incarnation of value classes didn't allow this sort of encapsulation, so we either invented goofy names like `__thingToAdd` or just picked `x` or `self`. But SI-7859 has delivered us the freedom to keep the accessor private. Should we keep any of these accessors around in a deprecated form? The implicit classes in Predef were added in 2.11.0-M2 (c26a8db067e4f), so they are okay. I think we can make reason that these APIs were both accidental and unlikely to be interpreted as public, so we can break them immediately. scala> Left(1).x res0: scala.util.Either[Int,Int] = Left(1) scala> import concurrent.duration._ import concurrent.duration._ scala> 1.n res1: Int = 1
* | Parser stack reduction peekingAheadSom Snytt2013-11-082-5/+8
| | | | | | | | | | | | | | | | Restores a form of the previous peekAhead bookkeeping. Instead of tracking the current token and offset outside of xxxAhead, peekingAhead uses `in.prev` and will push back if the operation results in an empty tree.
* | Parser stack reduction discussionSom Snytt2013-11-085-13/+13
| | | | | | | | Check files
* | Rewrites the parser stack reduction logic.Paul Phillips2013-11-083-9/+6
| | | | | | | | | | | | | | Centralizes the scattered logic surrounding erroneous pattern syntax. Consolidates the redundant lookahead implementations. Eliminates var manipulation in favor of recursion.
* | Force several tests to run using inline delambdafication.James Iry2013-11-063-0/+3
| | | | | | | | | | | | The differences when running with method based delambdafication aren't important enough yet to create specialized versions that use method based delambdafication.
* | Create test variants where delambdafication alters signatures.James Iry2013-11-064-0/+32
| | | | | | | | | | | | This commit includes several tests where there's a variation in signatures between inline delambdafication and method based delambdafication.
* | Add a skeletal Delambdafy phase.James Iry2013-11-014-44/+48
| | | | | | | | | | | | This commit adds a do-nothing phase called "Delambdafy" that will eventually be responsible for doing the final translation of lambdas into classes.
* | Merge pull request #3076 from soc/SI-7605-deprecate-proceduresJames Iry2013-10-293-0/+18
|\ \ | | | | | | SI-7605 Deprecate procedure syntax
| * | SI-7605 Deprecate procedure syntaxSimon Ochsenreither2013-10-243-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit covers three cases: - constructor definitions (def this {...}) - concrete method definitions (def foo {...}) - abstract method declarations (def foo) The deprecation is currently hidden behind -Xfuture pending IDE support for migrating users from procedures to methods.
* | | Merge pull request #3082 from retronym/ticket/6385Grzegorz Kossakowski2013-10-296-20/+21
|\ \ \ | | | | | | | | SI-6385 Avoid bridges to identical signatures over value classes
| * | | SI-6385 Avoid bridges to identical signatures over value classesJason Zaugg2013-10-286-20/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As Paul noted in the comments to SI-6260 (from which I mined some test cases) "there is no possible basis for conflict here": scala> class C[A](val a: Any) extends AnyVal defined class C scala> class B { def x[A](ca: C[A]) = () } defined class B scala> class D extends B { override def x[A](ca: C[A]) = () } <console>:8: error: bridge generated for member method x: [A](ca: C[A])Unit in class D which overrides method x: [A](ca: C[A])Unit in class B clashes with definition of the member itself; both have erased type (ca: Object)Unit class D extends B { override def x[A](ca: C[A]) = () } ^ What was happening? Bridge computation compares `B#x` and `D#x` exitingErasure, which results in comparing: ErasedValueType(C[A(in B#x)]) =:= ErasedValueType(C[A(in D#x)]) These types were considered distinct (on the grounds of the unique type hash consing), even though they have the same erasure and involve the same value class. That triggered creation of an bridge. After post-erasure eliminates the `ErasedValuedType`s, we find that this marvel of enginineering is bridges `(Object)Unit` right back onto itself. The previous resolution of SI-6385 (d435f72e5fb7fe) was a test case that confirmed that we detected the zero-length bridge and reported it nicely, which happened after related work in SI-6260. But we can simply avoid creating in it in the first place. That's what this commit does. It does so by reducing the amount of information carried in `ErasedValueType` to the bare minimum needed during the erasure -> posterasure transition. We need to know: 1. which value class wraps the value, so we can box and unbox as needed 2. the erasure of the underlying value, which will replace this type in post-erasure. This construction means that the bridge above computation now compares: ErasedValueType(C, Any) =:= ErasedValueType(C, Any]) I have included a test to show that: - we don't incur any linkage or other runtime errors in the reported case (run/t6385.scala) - a similar case compiles when the signatures align (pos/t6260a.scala), but does *not* compile when the just erasures align (neg/t6260c.scala) - polymorphic value classes continue to erase to the instantiated type of the unbox: (run/t6260b.scala) - other cases in SI-6260 remains unsolved and indeed unsolvable without an overhaul of value classes: (neg/t6260b.scala) In my travels I spotted a bug in corner case of null, asInstanceOf and value classes, which I have described in a pending test.
* | | | Remove orphaned check files and flags files.Jason Zaugg2013-10-274-15/+0
|/ / / | | | | | | | | | (for f in $(find test -name '*.check' -o -name '*.flags'); do bare=$(echo $f | sed -E 's/\.\w+$//'); ([[ -f "$bare" ]] || [[ -d "$bare" ]] || [[ -f "$bare.scala" ]] || [[ -f "$bare.test" ]] || echo $f) done;) | xargs rm
* | | Update description of explicitouter phase.Jason Zaugg2013-10-244-4/+4
| | | | | | | | | | | | Patern translation now happens earlier.
* | | Merge pull request #3026 from retronym/ticket/3871Jason Zaugg2013-10-234-0/+242
|\ \ \ | |/ / |/| | Tests for protected access
| * | SI-3871 Testing protected access against the specJason Zaugg2013-10-232-0/+224
| | | | | | | | | | | | | | | I've marked a few minor cases in the test with !!! where I believe the behaviour goes beyond the spec.
| * | SI-3871 Missing test case for protected bug.Jason Zaugg2013-10-092-0/+18
| | | | | | | | | | | | c39f26382dddaa7 fixed the bug but didn't commit a test case.
* | | Merge pull request #3070 from xeno-by/topic/macro-impl-wrong-shapeJason Zaugg2013-10-238-1/+21
|\ \ \ | | | | | | | | better macro impl shape errors
| * | | better macro impl shape errorsEugene Burmako2013-10-238-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the advent of quasiquotes, we allowed both arguments and return types of macro impls to be c.Tree's (as opposed to traditional c.Expr[T]'s). This warrants an update of macro def <-> macro impl signature mismatch errors that include a printout of suggested macro impl signatures. Now along with a signature that contains exprs, we suggest another signature that has all exprs replaced by trees
* | | | Merge pull request #3068 from retronym/ticket/7020-3-1Jason Zaugg2013-10-233-0/+50
|\ \ \ \ | | | | | | | | | | Deterministic warnings for pattern matcher, take 2
| * | | | SI-7020 Deterministic warnings for pattern matcher, take 2Jason Zaugg2013-10-223-0/+50
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous swing at determinism, ebb01e05cbe4, made decent contact but apparently didn't hit it out of the park. The test wavered every hundred or so runs, as witnessed occasionally in nightly builds or pull request validation. I setup a test to run neg/7020.scala a few hundred times, and could trigger the failure reliably. I then swept through the pattern matcher in search of HashMap and HashSet creation, and changed them all to the Linked variety. The results of that are published in retronym#ticket/7020-3 [1]. This commit represents the careful whittling down of that patch to the minimal change required to exhibit determinism. [1] https://github.com/retronym/scala/compare/ticket/7020-3
* | | | Merge pull request #3060 from harrah/t7519-bJason Zaugg2013-10-233-0/+28
|\ \ \ \ | | | | | | | | | | SI-7519: Additional test case covering sbt/sbt#914
| * | | | SI-7519: Additional test case covering sbt/sbt#914Mark Harrah2013-10-203-0/+28
| |/ / /
* | | | Merge pull request #3047 from xeno-by/topic/deprecateEugene Burmako2013-10-2213-47/+39
|\ \ \ \ | |/ / / |/| | | deprecates raw tree manipulation facilities in macros.Context
| * | | changes some manual tree constructions in macro tests to quasiquotesEugene Burmako2013-10-1813-47/+37
| | | |
| * | | deprecates raw tree manipulation facilities in macros.ContextEugene Burmako2013-10-186-18/+20
| | | |
* | | | Merge pull request #3007 from densh/pull/fresh-name-and-package-supportEugene Burmako2013-10-192-3/+3
|\ \ \ \ | | | | | | | | | | Add support for packages into quasiquotes and toolbox, improve handling of fresh names, unhardcode quasiquote expansion logic
| * | | | eliminate isCaseDefEnd override by moving the logic into stock parserDen Shabalin2013-10-181-1/+1
| | | | |