summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Avoid the `CNF budget exceeded` exception via smarter translation into CNF.Gerard Basler2014-10-2711-268/+646
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The exhaustivity checks in the pattern matcher build a propositional formula that must be converted into conjunctive normal form (CNF) in order to be amenable to the following DPLL decision procedure. However, the simple conversion into CNF via negation normal form and Shannon expansion that was used has exponential worst-case complexity and thus even simple problems could become untractable. A better approach is to use a transformation into an _equisatisfiable_ CNF-formula (by generating auxiliary variables) that runs with linear complexity. The commonly known Tseitin transformation uses bi- implication. I have choosen for an enhancement: the Plaisted transformation which uses implication only, thus the resulting CNF formula has (on average) only half of the clauses of a Tseitin transformation. The Plaisted transformation uses the polarities of sub-expressions to figure out which part of the bi-implication can be omitted. However, if all sub-expressions have positive polarity (e.g., after transformation into negation normal form) then the conversion is rather simple and the pseudo-normalization via NNF increases chances only one side of the bi-implication is needed. I implemented only optimizations that had a substantial effect on formula size: - formula simplification, extraction of multi argument operands - if a formula is already in CNF then the Tseitin/Plaisted transformation is omitted - Plaisted via NNF - omitted: (sharing of sub-formulas is also not implemented) - omitted: (clause subsumption)
* Debug printing for Any, not AnyRef, to include primitivesAdriaan Moors2014-10-261-3/+3
| | | | Signed-off-by: Gerard Basler <gerard.basler@gmail.com>
* And, Or take sets of PropsGerard Basler2014-10-263-39/+57
| | | | Remove redundant UniqueSym class.
* Merge pull request #4077 from gkossakowski/bump-versionGrzegorz Kossakowski2014-10-261-1/+1
|\ | | | | Bump version to 2.11.5 in build.number file.
| * Bump version to 2.11.5 in build.number file.Grzegorz Kossakowski2014-10-261-1/+1
| | | | | | | | | | Scala 2.11.4 release has been staged, we should start publishing snapshots for Scala 2.11.5 now.
* | Merge pull request #4071 from Blaisorblade/patch-3Jason Zaugg2014-10-241-93/+0
|\ \ | | | | | | Delete zipfile-bug.txt
| * | Delete zipfile-bug.txtPaolo G. Giarrusso2014-10-231-93/+0
| | | | | | | | | The observed bug is probably solved (or should have a ticket), this 4-year-old thread dump does not seem to belong here.
* | | Merge pull request #4073 from gkossakowski/bump-versionv2.11.4Lukas Rytz2014-10-231-1/+1
|\ \ \ | |/ / |/| / | |/ Bump version number in build.number to 2.11.4
| * Bump version number in build.number to 2.11.4Grzegorz Kossakowski2014-10-231-1/+1
|/ | | | | | This should happen every time we cut a new release. We don't touch versions.properties files because that file specifies dependencies and we don't want to depend on broken Scala 2.11.3 release.
* Merge pull request #4049 from lrytz/t8900Grzegorz Kossakowski2014-10-202-4/+15
|\ | | | | SI-8900 Don't assert !isDelambdafyFunction, it may not be accurate
| * SI-8900 Don't assert !isDelambdafyFunction, it may not be accurateLukas Rytz2014-10-152-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementations of isAnonymousClass, isAnonymousFunction, isDelambdafyFunction and isDefaultGetter check if a specific substring (eg "$lambda") exists in the symbol's name. SI-8900 shows an example where a class ends up with "$lambda" in its name even though it's not a delambdafy lambda class. In this case the conflict seems to be introduced by a macro. It is possible that the compiler itself never introduces such names, but in any case, the above methods should be implemented more robustly. This commit is band-aid, it fixes one specific known issue, but there are many calls to the mentioned methods across the compiler which are potentially wrong. Thanks to Jason for the test case!
* | Merge pull request #4067 from lrytz/t8926Grzegorz Kossakowski2014-10-202-4/+52
|\ \ | | | | | | SI-8926 default visbility RUNTIME for java annotations
| * | SI-8926 default visbility RUNTIME for java annotationsLukas Rytz2014-10-202-4/+52
| |/ | | | | | | | | | | | | | | | | | | | | When parsed from source, java annotation class symbol are lacking the `@Retention` annotation. In mixed compilation, java annotations are therefore emitted with visibility CLASS. This patch conservatively uses the RUNTIME visibility in case there is no @Retention annotation. The real solution is to fix the Java parser, logged in SI-8928.
* | Merge pull request #4048 from lrytz/t8899Grzegorz Kossakowski2014-10-206-139/+13
|\ \ | | | | | | [nomerge] SI-8899 Revert "SI-8627 make Stream.filterNot non-eager"
| * | [nomerge] SI-8899 Revert "SI-8627 make Stream.filterNot non-eager"Lukas Rytz2014-10-126-139/+13
| |/ | | | | | | | | | | | | | | | | This reverts commit 9276a1205f74fdec74206209712831913e93f359. The change is not binary compatible, See discussion on SI-8899. Making filterImpl non-private changes its call-sites (within TraversableLike) from INVOKESTATIC to INVOKEINTERFACE. Subclasses of TraversableLike compiled before this change don't have a mixin for filterImpl.
* | Merge pull request #4053 from lrytz/tmp/t8907Grzegorz Kossakowski2014-10-203-24/+66
|\ \ | |/ |/| SI-8907 Don't force symbol info in isModuleNotMethod
| * SI-8907 Don't force symbol info in isModuleNotMethodLukas Rytz2014-10-153-24/+66
|/ | | | | | | | | | | | | | Test case by Jason. RefChecks adds the lateMETHOD flag lazily in its info transformer. This means that forcing the `sym.info` may change the value of `sym.isMethod`. 0ccdb151f introduced a check to force the info in isModuleNotMethod, but it turns out this leads to errors on stub symbols (SI-8907). The responsibility to force info is transferred to callers, which is the case for other operations on symbols, too.
* Merge pull request #4039 from roberthoedicke/2.11.xJason Zaugg2014-10-107-11/+11
|\ | | | | Minor spelling corrections and fix of the claimed outcome of the examples in the section on repeated parameters
| * Update 04-basic-declarations-and-definitions.mdRobert Hoedicke2014-10-101-3/+3
| | | | | | Reverted the claimed result values of the example in the section on repeated parameters and changed the code of the example method instead.
| * Update 12-the-scala-standard-library.mdroberthoedicke2014-10-091-1/+1
| | | | | | Changed "in" to "by the".
| * Update 10-xml-expressions-and-patterns.mdroberthoedicke2014-10-091-1/+1
| | | | | | Changed two wrong plurals to singulars, and inserted a comma in an enumeration of alternatives before the last "or".
| * Update 08-pattern-matching.mdroberthoedicke2014-10-081-2/+2
| | | | | | | | Elided superfluous "a". Corrected "no" to "not".
| * Update 06-expressions.mdroberthoedicke2014-10-081-3/+3
| | | | | | | | Inserted two missing instances of the word "the". Corrected "invokeDynamic" to "applyDynamic".
| * Update 04-basic-declarations-and-definitions.mdroberthoedicke2014-10-081-2/+2
| | | | | | Corrected the claimed outcome of the example in the section on repeated parameters. The example method sum sums up the _squares_ of the arguments.
| * Update 03-types.mdroberthoedicke2014-10-081-1/+1
| | | | | | Inserted missing word "bounds".
| * Update 03-types.mdroberthoedicke2014-10-081-1/+1
| | | | | | Fixed typo.
| * Update 02-identifiers-names-and-scopes.mdroberthoedicke2014-10-081-1/+1
| | | | | | Fixed typo.
* | Merge pull request #4038 from adriaanm/t8894v2.11.3Grzegorz Kossakowski2014-10-093-2/+14
|\ \ | | | | | | SI-8894 dealias when looking at tuple components
| * | SI-8894 dealias when looking at tuple componentsAdriaan Moors2014-10-083-2/+14
| |/ | | | | | | | | | | | | Classic bait-and-switch: `isTupleType` dealiases, but `typeArgs` does not. When deciding with `isTupleType`, process using `tupleComponents`. Similar for other combos. We should really enforce this using extractors, and only decouple when performance is actually impacted.
* | Merge pull request #3993 from puffnfresh/feature/color-replGrzegorz Kossakowski2014-10-095-5/+49
|\ \ | | | | | | Color REPL under -Dscala.color
| * | Use color REPL after writing a defBrian McKenna2014-10-071-10/+19
| | |
| * | Add color to severity in REPL reporterBrian McKenna2014-09-242-1/+19
| | | | | | | | | | | | | | | * Errors are red * Warnings are yellow
| * | Color REPL under -Dscala.colorBrian McKenna2014-09-213-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already use -Dscala.color when using -Ytyper-debug This tries to reuse the colors chosen from the debug flag: * Bold blue for vals (e.g. "res0") * Bold green for types (e.g. "Int") * Magenta for the shell prompt (e.g. "scala>")
* | | Merge pull request #4037 from adriaanm/t8890Grzegorz Kossakowski2014-10-093-16/+40
|\ \ \ | |_|/ |/| | SI-8890 handle reference to overload with error
| * | SI-8890 handle reference to overload with errorAdriaan Moors2014-10-093-16/+40
|/ / | | | | | | | | | | | | When buffering, we must report the ambiguity error to avoid a stack overflow. When the error refers to erroneous types/symbols, we don't report it directly to the user, because there will be an underlying error that's the root cause.
* | Merge pull request #4032 from dturner-tw/dturner/scaldoc-exit-codeGrzegorz Kossakowski2014-10-071-9/+11
|\ \ | | | | | | Make Scaladoc actually exit with non-zero exit code in case of errors, as its docs say it does
| * | Make Scaladoc actually exit with non-zero exit code in case of errors,David Turner2014-10-041-9/+11
| | | | | | | | | | | | as its docs say it does.
* | | Merge pull request #4026 from soc/SI-4788-newGrzegorz Kossakowski2014-10-0724-120/+238
|\ \ \ | | | | | | | | SI-4788/SI-5948 Respect RetentionPolicy of Java annotations
| * | | SI-4788/SI-5948 Respect RetentionPolicy of Java annotationsSimon Ochsenreither2014-10-0724-120/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that I removed the check to ignore @deprecated: - @deprecated extends StaticAnnotation, so they aren't supposed to show up in the RuntimeInvisibleAnnotation attribute anyway, and the earlier check for "extends ClassfileAnnotationClass" makes this check superflous anyway. - Otherwise, if @deprecated was extending ClassfileAnnotationClass it would seem inconsistent that we don't emit @deprecated, but would do so for @deprecatedOverriding, @deprecatedInheritance, etc. Anyway, due to ClassfileAnnotation not working in Scala, and the additional check which only allows Java-defined annotations, this is pretty pointless from every perspective.
* | | | Merge pull request #4028 from soc/topic/serialversionuid-spamGrzegorz Kossakowski2014-10-071-1/+4
|\ \ \ \ | |/ / / |/| | | Avoid ClassfileAnnotation warning for @SerialVersionUID
| * | | Avoid ClassfileAnnotation warning for @SerialVersionUIDSimon Ochsenreither2014-10-071-1/+4
|/ / / | | | | | | | | | | | | | | | @SerialVersionUID is special-cased, the warning doesn't apply. Related to SI-7041.
* | | Merge pull request #4030 from som-snytt/issue/8843Grzegorz Kossakowski2014-10-076-53/+230
|\ \ \ | | | | | | | | SI-8843 AbsFileCL acts like a CL
| * | | SI-8843 AbsFileCL acts like a CLSom Snytt2014-10-066-53/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let the AbstractFileClassLoader override just the usual suspects. Normal delegation behavior should ensue. That's instead of overriding `getResourceAsStream`, which was intended that "The repl classloader now works more like you'd expect a classloader to." (Workaround for "Don't know how to construct an URL for something which exists only in memory.") Also override `findResources` so that `getResources` does the obvious thing, namely, return one iff `getResource` does. The translating class loader for REPL only special-cases `foo.class`: as a fallback, take `foo` as `$line42.$read$something$foo` and try that class file. That's the use case for "works like you'd expect it to." There was a previous fix to ensure `getResource` doesn't take a class name. The convenience behavior, that `classBytes` takes either a class name or a resource path ending in ".class", has been promoted to `ScalaClassLoader`.
* | | | Merge pull request #4034 from adriaanm/pr-3950-reworkGrzegorz Kossakowski2014-10-071-3/+9
|\ \ \ \ | | | | | | | | | | Update stripPrefix/StringLike docs to talk about no op case
| * | | | Update stripPrefix/StringLike docs to talk about no op caseMax Bileschi2014-10-071-3/+9
| | | | | | | | | | | | | | | | | | | | Incorporate review comments by Som Snytt.
* | | | | Merge pull request #3986 from som-snytt/issue/6502-no-cpGrzegorz Kossakowski2014-10-075-71/+74
|\ \ \ \ \ | | | | | | | | | | | | SI-6502 Repl reset/replay take settings args
| * | | | | SI-6502 Repl reset/replay take settings argsSom Snytt2014-09-225-70/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reset and replay commands take arbitrary command line args. When settings args are supplied, the compiler is recreated. For uniformity, the settings command performs only the usual arg parsing: use -flag:true instead of +flag, and clearing a setting is promoted to the command line, so that -Xlint: is not an error but clears the flags. ``` scala> maqicode.Test main null <console>:8: error: not found: value maqicode maqicode.Test main null ^ scala> :reset -classpath/a target/scala-2.11/sample_2.11-1.0.jar Resetting interpreter state. Forgetting all expression results and named terms: $intp scala> maqicode.Test main null Hello, world. scala> val i = 42 i: Int = 42 scala> s"$i is the loneliest numbah." res1: String = 42 is the loneliest numbah. scala> :replay -classpath "" Replaying: maqicode.Test main null Hello, world. Replaying: val i = 42 i: Int = 42 Replaying: s"$i is the loneliest numbah." res1: String = 42 is the loneliest numbah. scala> :replay -classpath/a "" Replaying: maqicode.Test main null <console>:8: error: not found: value maqicode maqicode.Test main null ^ Replaying: val i = 42 i: Int = 42 Replaying: s"$i is the loneliest numbah." res1: String = 42 is the loneliest numbah. ``` Clearing a clearable setting: ``` scala> :reset -Xlint:missing-interpolator Resetting interpreter state. scala> { val i = 42 ; "$i is the loneliest numbah." } <console>:8: warning: possible missing interpolator: detected interpolated identifier `$i` { val i = 42 ; "$i is the loneliest numbah." } ^ res0: String = $i is the loneliest numbah. scala> :reset -Xlint: Resetting interpreter state. Forgetting this session history: { val i = 42 ; "$i is the loneliest numbah." } scala> { val i = 42 ; "$i is the loneliest numbah." } res0: String = $i is the loneliest numbah. ```
| * | | | | SI-6502 Remove cp command as unworkableSom Snytt2014-09-211-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | People expect to change the class path midstream. Let's disabuse them by removing the broken command. The internals are deprecated.
* | | | | | Merge pull request #4016 from lrytz/t8731Grzegorz Kossakowski2014-10-0712-19/+93
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | SI-8731 warning if @switch is ignored
| * | | | | SI-8731 warning if @switch is ignoredLukas Rytz2014-10-0612-19/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For matches with two or fewer cases, @switch is ignored. This should not happen silently.