summaryrefslogtreecommitdiff
path: root/test/files
Commit message (Collapse)AuthorAgeFilesLines
* SI-7474 Record extra errors in Throwable#suppressedExceptionsJason Zaugg2016-03-292-5/+12
| | | | | | | ... in parallel collection operations. Followup to bcbe38d18, which did away with the the approach to use a composite exception when more than one error happened.
* Merge pull request #5053 from som-snytt/issue/9314Lukas Rytz2016-03-232-13/+44
|\ | | | | SI-9314 Marginal edge case to warn-missing-interp
| * SI-9314 No warn on ${nonid}Som Snytt2016-03-232-6/+25
| | | | | | | | | | Use the sym test on an expr that happens to be a subset of idents and is not in scope. Other `${ operator_* }` warn.
| * SI-9314 Ignore "${}"Som Snytt2016-03-201-0/+2
| | | | | | | | | | | | | | As an Easter egg, let "${} $x" forego the check on `x`. In other words, empty expression interpolation looks too degenerate to check.
| * SI-9314 Don't warn on "$pkg"Som Snytt2016-03-202-8/+18
| | | | | | | | | | Edge cases of things not to warn about include package names.
* | Support :require when using the flat classpath representation.Lukas Rytz2016-03-221-25/+20
| | | | | | | | | | | | :require was re-incarnated in https://github.com/scala/scala/pull/4051, it seems to be used by the spark repl. This commit makes it work when using the flat classpath representation.
* | Merge pull request #5043 from dongjoon-hyun/fix_typos_in_spec_and_commentsJason Zaugg2016-03-211-1/+1
|\ \ | | | | | | Fix some typos in `spec` documents and comments.
| * | Fix some typos in `spec` documents and comments.Dongjoon Hyun2016-03-151-1/+1
| |/
* | Remove manual mixins in JFunctionN.v2.12.0-M3-dc9effeJason Zaugg2016-03-1824-264/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These manual mixins were forwarding to the impl classes have just been removed. We can now rely on default methods instead. Update Tests: - Fix test/files/pos/t1237.scala, we can't have an outer field in an interface, always use the outer method. - Don't crash on meaningless trait early init fields test/files/neg/t2796.scala - Remove impl class relate parts of inner class test - Remove impl class relate parts of elidable test - Remove impl class related reflection test. - Remove test solely about trait impl classes renaming - Update check file with additional stub symbol error - Disable unstable parts of serialization test. - TODO explain, and reset the expectation
* | New trait encoding: use default methods, jettison impl classesJason Zaugg2016-03-183-6/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, concrete methods in traits were encoded with "trait implementation classes". - Such a trait would compile to two class files - the trait interface, a Java interface, and - the implementation class, containing "trait implementation methods" - trait implementation methods are static methods has an explicit self parameter. - some methods don't require addition of an interface method, such as private methods. Calls to these directly call the implementation method - classes that mixin a trait install "trait forwarders", which implement the abstract method in the interface by forwarding to the trait implementation method. The new encoding: - no longer emits trait implementation classes or trait implementation methods. - instead, concrete methods are simply retained in the interface, as JVM 8 default interface methods (the JVM spec changes in [JSR-335](http://download.oracle.com/otndocs/jcp/lambda-0_9_3-fr-eval-spec/index.html) pave the way) - use `invokespecial` to call private or particular super implementations of a method (rather `invokestatic`) - in cases when we `invokespecial` to a method in an indirect ancestor, we add that ancestor redundantly as a direct parent. We are investigating alternatives approaches here. - we still emit trait fowrarders, although we are [investigating](https://github.com/scala/scala-dev/issues/98) ways to only do this when the JVM would be unable to resolve the correct method using its rules for default method resolution. Here's an example: ``` trait T { println("T") def m1 = m2 private def m2 = "m2" } trait U extends T { println("T") override def m1 = super[T].m1 } class C extends U { println("C") def test = m1 } ``` The old and new encodings are displayed and diffed here: https://gist.github.com/retronym/f174d23f859f0e053580 Some notes in the implementation: - No need to filter members from class decls at all in AddInterfaces (although we do have to trigger side effecting info transformers) - We can now emit an EnclosingMethod attribute for classes nested in private trait methods - Created a factory method for an AST shape that is used in a number of places to symbolically bind to a particular super method without needed to specify the qualifier of the `Super` tree (which is too limiting, as it only allows you to refer to direct parents.) - I also found a similar tree shape created in Delambdafy, that is better expressed with an existing tree creation factory method, mkSuperInit.
* Merge pull request #4974 from szeiger/wip/patmat-outertestAdriaan Moors2016-03-146-2/+145
|\ | | | | More conservative optimization for unnecessary outer ref checks
| * Improved outer ref checking in pattern matches:Adriaan Moors2016-03-076-2/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old algorithm omitted necessary outer ref checks in some places. This new one is more conservative. It only omits outer ref checks when the expected type and the scrutinee type match up, or when the expected type is defined in a static location. For this specific purpose the top level of a method or other code block (which is not a trait or class definition) is also considered static because it does not have a prefix. This change comes with a spec update to clarify the prefix rule for type patterns. The new wording makes it clear that the presence of a prefix is to be interpreted in a *semantic* way, i.e. the existence of a prefix determines the necessity for an outer ref check, no matter if the prefix is actually spelled out *syntactically*. Note that the old outer ref check implementation did not use the alternative interpretation of requiring prefixes to be given syntactically. It never created an outer ref check for a local class `C`, no matter if the pattern was `_: C` or `_: this.C`, thus violating both interpretations of the spec. There is now explicit support for unchecked matches (like `case _: (T @unchecked) =>`) to suppress warnings for unchecked outer refs. `@unchecked` worked before and was used for this purpose in `neg/t7721` but never actually existed as a feature. It was a result of a bug that prevented an outer ref check from being generated in the first place if *any* annotation was used on an expected type in a type pattern. This new version will still generate the outer ref check if an outer ref is available but suppress the warning otherwise. Other annotations on type patterns are ignored. New tests are in `neg/outer-ref-checks`. The expected results of tests `neg/t7171` and `neg/t7171b` have changed because the compiler now tries to generate additional outer ref checks that were not present before (which was a bug).
* | Merge 2.11.x into 2.12.xAdriaan Moors2016-03-145-0/+70
|\ \ | | | | | | | | | Resolved conflicts as in b0e05b67c7
| * | SI-9425 Fix a residual bug with multi-param-list case classesJason Zaugg2016-03-041-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | During code review for the fix for SI-9546, we found a corner case in the SI-9425 that remained broken. Using `finalResultType` peels off all the constructor param lists, and solves that problem.
| * | SI-9546 Fix regression in rewrite of case apply to constructor callJason Zaugg2016-03-021-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In SI-9425, I disabled the rewrite of `CaseClass.apply(x)` to `new CaseClass(x)` if the constructor was was less accessible than the apply method. This solved a problem with spurious "constructor cannot be accessed" errors during refchecks for case classes with non-public constructors. However, for polymorphic case classes, refchecks was persistent, and even after refusing to transform the `TypeApply` within: CaseClass.apply[String]("") It *would* try again to transform the enclosing `Select`, a code path only intended for monomorphic case classes. The tree has a `PolyType`, which foiled the newly added accessibility check. I've modified the call to `isSimpleCaseApply` from the transform of `Select` nodes to exclude polymorphic apply's from being considered twice.
| * | Refactor transform of case apply in refchecksJason Zaugg2016-03-023-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've identified a dead call to `transformCaseApply` that seems to date back to Scala 2.6 vintages, in which case factory methods were a fictional companion method, rather than a real apply method in a companion module. This commit adds an abort in that code path to aide code review (if our test suite still passes, we know that I've removed dead code, rather than silently changing behaviour.) The following commit will remove it altogether I then inlined a slightly clunky abstraction in the two remaining calls to `transformCaseApply`. It was getting in the way of a clean fix to SI-9546, the topic of the next commit.
| * | Update partest to 1.0.12, test case for reporting invalid flagsLukas Rytz2016-02-175-2/+12
| | | | | | | | | | | | | | | | | | Conflicts: test/files/pos/t3420.flags versions.properties
* | | SI-9658 Fix crosstalk between partial fun. and GADT matchJason Zaugg2016-03-041-0/+10
| |/ |/| | | | | | | | | | | | | | | | | | | | | When typechecking the synthetic default case of a pattern matching anonymous partial function, we failed to create a new `Context`. This led to crosstalk with the management of the saved type bounds of an enclosing GADT pattern match. This commit avoids the direct call to `typeCase` and instead indirects through `typedCases`, which spawns a new nested typer context, and hence avoids the crosstalk when `restoreSavedTypeBounds` runs.
* | Merge pull request #4968 from lrytz/oldOptCleanupAdriaan Moors2016-02-2439-127/+21
|\ \ | | | | | | Remove -Y settings that are no longer used in 2.12
| * | Remove -Y settings that are no longer used in 2.12Lukas Rytz2016-02-1625-83/+15
| | | | | | | | | | | | | | | | | | Added a deprecation warning for `-optimize`. Later we'll also graduate `-Yopt` to `-opt`, probably for 2.12.0-M5.
| * | Rewrite a few more tests to the new optimizerLukas Rytz2016-02-1514-44/+6
| | |
* | | Merge pull request #4958 from adriaanm/typerefrefactorAdriaan Moors2016-02-241-2/+2
|\ \ \ | |/ / |/| | Simplify TypeRef hierarchy. baseType returns NoType, as needed for isSubtype. Also improves performance.
| * | SI-9540 typedFunction is erasure awareAdriaan Moors2016-02-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When typer is running during erasure, must assign erased FunctionType in typedFunction. This removes a bunch of unneeded casts now we no longer assign a half-erased FunctionType. I poked around a bit, and it looks like erasure doesn't want typer to erase built-in types (like Unit/Any/Nothing). They are already treated specially during erasure.
* | | Merge pull request #4944 from lrytz/stringBuilderNoBoxLukas Rytz2016-02-121-1/+1
|\ \ \ | | | | | | | | SI-9571 Avoid boxing primitives in string concatenation
| * | | SI-9571 Avoid boxing primitives in string concatenationMarko Elezovic2016-02-061-1/+1
| | | |
* | | | Merge pull request #4896 from retronym/topic/indy-all-the-thingsJason Zaugg2016-02-128-23/+152
|\ \ \ \ | | | | | | | | | | Use invokedynamic for structural calls, symbol literals, lambda ser.
| * | | | Use invokedynamic for structural calls, symbol literals, lamba ser.Jason Zaugg2016-01-298-23/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous encodings created static fields in the enclosing class to host caches. However, this isn't an option once emit code in default methods of interfaces, as Java interfaces don't allow private static fields. We could continue to emit fields, and make them public when added to traits. Or, as chosen in this commit, we can emulate a call-site specific static field by using invokedynamic: when the call site is linked, our bootstrap methid can perform one-time computation, and we can capture the result in the CallSite. To implement this, I've allowed encoding of arbitrary invokedynamic calls in ApplyDynamic. The encoding is: ApplyDynamic( NoSymbol.newTermSymbol(TermName("methodName")).setInfo(invokedType) Literal(Constant(bootstrapMethodSymbol)) :: ( Literal(Constant(staticArg0)) :: Literal(Constant(staticArgN)) :: Nil ) ::: (dynArg0 :: dynArgN :: Nil) ) So far, static args may be `MethodType`, numeric or string literals, or method symbols, all of which can be converted to constant pool entries. `MethodTypes` are transformed to the erased JVM type and are converted to descriptors as String constants. I've taken advantage of this for symbol literal caching and for the structural call site cache. I've also included a test case that shows how a macro could target this (albeit using private APIs) to cache compiled regexes. I haven't managed to use this for LambdaMetafactory yet, not sure if the facility is general enough.
* | | | | Merge pull request #4955 from som-snytt/issue/8685-depr-caseLukas Rytz2016-02-104-1/+107
|\ \ \ \ \ | | | | | | | | | | | | SI-9650 Refchecks on case apply transform
| * | | | | SI-9650 Refchecks on case apply transformSom Snytt2016-02-104-1/+107
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | Apply checks for unsavoriness when transforming a case apply.
* | | | | Merge pull request #4924 from ShaneDelmore/SI-9452Lukas Rytz2016-02-101-1/+2
|\ \ \ \ \ | |/ / / / |/| | | | SI-9452: Extend BigDecimal with Ordered for java interop
| * | | | Merge branch '2.12.x' into SI-9452Shane Delmore2016-02-0446-191/+76
| |\ \ \ \ | | | |/ / | | |/| |
| * | | | Extend BigInt with Ordered for java interopShane Delmore2016-02-011-1/+2
| | | | |
* | | | | Merge pull request #4938 from retronym/ticket/9349Jason Zaugg2016-02-102-0/+22
|\ \ \ \ \ | | | | | | | | | | | | SI-9349 Fix use of patmat binder as prefix for new x.Inner
| * | | | | SI-9349 Fix use of patmat binder as prefix for new x.InnerJason Zaugg2016-02-022-0/+22
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When substituting in references to the synthetic values representing pattern binders, we were replacing: Select(Ident(o).setType(o.type), TypeName("Inner")) with: Select(Ident(x2).setType(typeOf[Outer]), TypeName("Inner")) The post transform in uncurry would then run: else if (tree.isType) TypeTree(tree.tpe) setPos tree.pos Which would loses track of the outer term `o` and crashes the compiler in ExplicitOuter. This commit generates stable references to the binders. I made this change in the substitutions for all `TreeMakers`, however only one of seems like it triggers a crash in the test variations I tried. Here's how the trees for the first pattern in the test case change after this patch: ``` @@ -1,30 +1,30 @@ [[syntax trees at end of patmat]] // test.scala package <empty>{<empty>.type} { object Test extends scala.AnyRef { def <init>(): Test.type = { Test.super{Test.type}.<init>{()Object}(){Object}; (){Unit} }{Unit}; def main(args: Array[String]): Unit = { val o1: Outer = Outer.apply{(i: Int)Outer}(5{Int(5)}){Outer}; { case <synthetic> val x1: Outer = o1{Outer}; case5(){ if (x1.ne{(x$1: AnyRef)Boolean}(null{Null(null)}){Boolean}) matchEnd4{(x: Unit)Unit}({ - val i: Outer#Inner = new x1.Inner{Outer#Inner}{()Outer#Inner}(){Outer#Inner}; + val i: x1.Inner = new x1.Inner{x1.Inner}{()x1.Inner}(){x1.Inner}; (){Unit} }{Unit}){Unit} else case6{()Unit}(){Unit}{Unit} }{Unit}; case6(){ matchEnd4{(x: Unit)Unit}(throw new MatchError{MatchError}{(obj: Any)MatchError}(x1{Outer}){MatchError}{Nothing}){Unit} }{Unit}; matchEnd4(x: Unit){ x{Unit} }{Unit} }{Unit} }{Unit} } ```
* | | | | Merge pull request #4868 from retronym/ticket/9542-comboJason Zaugg2016-02-101-0/+8
|\ \ \ \ \ | | | | | | | | | | | | SI-9542 Fix regression in value classes (served two ways)
| * | | | | SI-9542 Unify different reprs. of module type refsJason Zaugg2016-02-011-0/+8
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new unit test shows failures in transitivity of subtyping and type equivalence, which boil down the the inconsistent handling of the semantically equivalent: ThisType(pre, ModuleClass) ModuleTypeRef(pre, ModuleClass) SingleType(pre, Module) This commit: - adds a case to `normalizePlus` to unwrap a `ThisType` to a `ModuleTypeRef` - Use `normalizePlus` more widely during subtype comparison - refactor `fourthTry` (part of `isSubType`) to remove code that becomes obviated by the use of `normalizePlus`. This fixes the regression in the extension methods phase which was triggered by https://github.com/scala/scala/pull/4749. We can also fix that regression by tweaking the extension methods phase itself to emit the `ThisType` representation of the owner of the value class, as before. I plan to demonstrate the two approaches to fixing the regression on separate branches, and the propose that the merged result of these two is useds.
* | | | | SI-9574 Prevent illegal overrides of members with module typesStefan Zeiger2016-02-082-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit f32a32b1b33c9d7ccd62467e3e10cb69930023c8 introduced the ability to override objects with other objects. The exception that allows these overrides (where the usual subtyping check fails) was applied to all members whose type is a module class. This is too broad, however, because it not only applies to members of the form `object foo` but also `def foo: bar.type` (where `bar` is an `object`). The fix is to restrict the exception to those cases where both definitions actually are objects.
* | | | | Merge remote-tracking branch 'origin/2.12.x' into ↵Jason Zaugg2016-02-0446-191/+76
|\ \ \ \ \ | | |_|/ / | |/| | | | | | | | merge/2.11.x-to-2.12.x-20160203
| * | | | Merge pull request #4940 from lrytz/partestUpgradeSeth Tisue2016-02-034-1/+11
| |\ \ \ \ | | | | | | | | | | | | Update partest to 1.0.12, test case for reporting invalid flags
| | * | | | Update partest to 1.0.12, test case for reporting invalid flagsLukas Rytz2016-02-035-2/+12
| | |/ / /
| * | | | Merge pull request #4920 from lrytz/oldOptimizerTestsLukas Rytz2016-02-0342-190/+65
| |\ \ \ \ | | |/ / / | |/| | | restore / rewrite various tests
| | * | | Re-write and Re-enable optimizer testsLukas Rytz2016-02-0342-190/+65
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite tests for new optimizer - SI-6941 - SI-2171 - t3430 - t3252 - t4840 - t2171 - t3430 - t3252 - t6157 - t6547 - t8062 - t8306 - t8359 - t9123 - trait-force-info - private-inline test cases for bugs fixed in the new optimizer - SI-9160, the unnecessary boxing mentioned in the ticket is optimzied since push-pop elimination (#4858). - SI-8796 - SI-8524 - SI-7807 fix flags file for t3420 remove an empty flags file remove unnecessary partest filters explicit inliner warnings in test t7582 Restore the lisp test. Removing the flags file - our build runs with the (new) optimizer enabled anyway. The test spent the past few years as an optimizer test in pos/ see https://issues.scala-lang.org/browse/SI-4512. The attempt may fail, but why not give it a try. $ git lg -S"lisp" ... | * | | | f785785 - SI-4579 Yoke the power of lisp.scala as a stress for the optimizer. (3 years, 8 months ago) <Jason Zaugg> ... * | | | | | | 622cc99 - Revert the lisp test. (3 years, 10 months ago) <Paul Phillips> ... * | | | | | | 97f0324 - Revived the lisp test. (3 years, 10 months ago) <Paul Phillips> ... * | 1e0f7dc - Imprison the lisp test, no review. (4 years, 4 months ago) <Paul Phillips> ... * | 6b09630 - "Freed the lisp test." Tweaked partest defaults... (4 years, 6 months ago) <Paul Phillips> ... * | fec42c1 - Lisp test wins again, no review. (4 years, 8 months ago) <Paul Phillips> ... * | 1c2d44d - Restored the lisp.scala test. (4 years, 8 months ago) <Paul Phillips> ... * | 15ed892 - Temporarily sending lisp.scala to be interprete... (4 years, 8 months ago) <Paul Phillips> ...
* | | | Merge commit 'cc6fea6' into merge/2.11.x-to-2.12.x-20160203Jason Zaugg2016-02-043-1/+14
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | Conflicts: build.sbt scripts/jobs/integrate/bootstrap
| * | | SI-9572 Check for illegal tuple sizes in the parserStefan Zeiger2016-01-282-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds explicit checks with syntax errors for tuple literals and types of more than 22 elements. An alternative approach to fixing SI-9572 would be to revert to the old failure mode of Scala 2.10 where references to arbitrary `scala.TupleXY` would be generated in the parser, which then leads to “type/object not found” errors in the typechecker. This fix here is more intrusive but arguably provides a better user experience. Methods `stripParens` and `makeBinop` are moved from `TreeBuilder` to `Parsers` because they can now generate syntax errors. New methods `makeSafeTupleType` and `makeSafeTupleTerm` implement the error checking on top of `makeTupleType` and `makeTupleTerm`. They are overridden with no-op versions in the quasiquotes parser because it also overrides `makeTupleType` and `makeTupleTerm` in a way that supports arbitrary tuple sizes.
| * | | Merge pull request #4899 from som-snytt/issue/9616Jason Zaugg2016-01-193-12/+81
| |\ \ \ | | | | | | | | | | [backport] SI-9616 False positive in unused import warning
| | * | | [backport] SI-9616 False positive in unused import warningSom Snytt2016-01-073-12/+81
| | | | | | | | | | | | | | | | | | | | This is a minimal backport of the fix for SI-9383.
* | | | | Merge commit 'bf599bc' into merge/2.11.x-to-2.12.x-20160203Jason Zaugg2016-02-035-4/+77
|\| | | | | |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/backend/opt/ConstantOptimization.scala src/compiler/scala/tools/nsc/transform/Constructors.scala src/compiler/scala/tools/nsc/typechecker/Contexts.scala src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala src/scaladoc/scala/tools/nsc/doc/html/resource/lib/jquery.layout.js
| * | | disable flaky presentation compiler test on WindowsSeth Tisue2016-01-151-0/+6
| |/ / | | | | | | | | | see https://github.com/scala/scala-dev/issues/72 for details
| * | Merge pull request #4862 from retronym/ticket/9567Lukas Rytz2015-12-183-0/+66
| |\ \ | | | | | | | | SI-9567 Fix pattern match on 23+ param, method local case class
| | * | SI-9567 Fix pattern match on 23+ param, method local case classJason Zaugg2015-11-252-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Typechecking constructor patterns of method local case classes was only working because of the existence of the unapply method in the companion, which is used if navigation to the case class companion object fails. We now support defintion of, and pattern matching on, case classes with more than 22 parameters. These have no `unapply` method in the companion, as we don't have a large enough tuple type to return. So for such case classes, the fallback that we inadvertently relied on would no longer save us, and we'd end up with a compile error advising that the identifier in the constructor pattern was neither a case class nor an extractor. This is due to the propensity of `Symbol#companionXxx` to return `NoSymbol` when in the midst of typechecking. That method should only be relied upon after typechecking. During typechecking, `Namers#companionSymbolOf` should be used instead, which looks in the scopes of enclosing contexts for symbol companionship. That's what I've done in this commit.