summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* SI-8040 Improve unused warningsSom Snytt2017-03-111-7/+26
| | | | | | | Add symbol names, don't warn for both getters and setters or for synthetics (except default arg getters). Tweak messages for readability.
* Merge pull request #5675 from piyush-jaiswal/issue/9729som-snytt2017-03-101-2/+2
|\ | | | | Add tests for ConsoleReporter.
| * Add tests for ConsoleReporter.piyush-jaiswal2017-03-111-2/+2
| |
* | Merge pull request #5761 from lrytz/sd329Adriaan Moors2017-03-101-5/+13
|\ \ | | | | | | Don't use `equals` for comparing java.lang.Double/Float
| * | Don't use `equals` for comparing java.lang.Double/FloatLukas Rytz2017-03-091-5/+13
| | | | | | | | | | | | | | | | | | | | | Fixes https://github.com/scala/scala-dev/issues/329 The `equals` method for java.lang.Double/Float behaves differently than comparing the `doubleValue`s / `floatValues` for `-0.0`/`0.0`/`NaN`.
* | | Merge pull request #5719 from retronym/ticket/10187Adriaan Moors2017-03-101-2/+10
|\ \ \ | | | | | | | | SI-10187 Support mutation of mutable.HashMap in getOrElseUpdate
| * | | SI-10187 Support mutation of mutable.HashMap in getOrElseUpdateJason Zaugg2017-03-031-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scala 2.12.1 included optimizations to `HashMape.getOrElseUpdate` to avoid recomputing the index in the hash table when adding an the element. However, this index could be stale if the callback added elements to the map and triggered a resize. This commit checks that the table is unchanged before reusing the index, restoring the 2.12.0 behaviour.
* | | | SI-8969 Accept poly+implicit for assignment syntaxSom Snytt2017-03-091-0/+1
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow-up to fb061f22d4c35df626d9651e017820a11f8fe56e which allowed the type param only. Reported: ``` scala> object Test { | def a[R](implicit s: List[R]):Int = 0 | def a_=[R](v: Int)(implicit s: List[R]) = () | } ```
* | | new version numbers for snapshot and integration builds, new repositoryLukas Rytz2017-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Integration builds now have version number like `2.12.2-bin-sha7` or `2.13.0-pre-sha7` and are published to scala-integration (no longer scala-release-temp). scala-release-temp is still used in the bootstrap script for publishing intermediate artifacts (starr, locker). Various cleanups in the scripts.
* | | Merge pull request #5600 from paplorinc/HashTable_indexSeth Tisue2017-03-063-18/+5
|\ \ \ | | | | | | | | Further small HashTable optimizations
| * | | Optimized HashTable.nextPositivePowerOfTwoPap Lőrinc2017-02-183-18/+5
| |/ /
* | | Merge pull request #5754 from Philippus/issue/html-tag-in-hoverLukas Rytz2017-03-041-1/+1
|\ \ \ | | | | | | | | fix regression in scaladoc
| * | | pattern for entitylink was too narrow, cleaned up the testsPhilippus Baalman2017-03-031-1/+1
| | | |
* | | | Merge pull request #5671 from retronym/topic/stubby-2Lukas Rytz2017-03-034-7/+9
|\ \ \ \ | | | | | | | | | | Avoid compiler crash with missing transitive dependencies
| * | | | Remove non-essential fix for stub symbol failureJason Zaugg2017-03-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Given that we correctly setup the flags on the stub symbol, we no longer trip an assertion in ModuleTypeRef's constructor.
| * | | | Avoid forcing info transforms of primitive methodsJason Zaugg2017-02-192-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although this is cheap, when debugging log output of info transformer activity this was a major source of noise. This commit avoids the info lookup for methods other than `+`, and then for `+` uses the typer phase info to distinguish concatentation from addition.
| * | | | Avoid stub symbol related crash in backendJason Zaugg2017-02-193-2/+3
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this test case, the backend forces the specialization info transform of `Sub` during computation of its inner class metadata. This in turn runs the info transforms of the `Base`. This leads to the uncurry info tranform transforming a signature that has a type alias as a method parameter type. Subsequent substution of the new method symbol into the result type, which includes a stub symbol for an absent class, tripped an assertion: ``` requirement failed: package b java.lang.IllegalArgumentException: requirement failed: package b at scala.Predef$.require(Predef.scala:277) at scala.reflect.internal.Types$ModuleTypeRef.<init>(Types.scala:1879) at scala.reflect.internal.Types$PackageTypeRef.<init>(Types.scala:1897) at scala.reflect.internal.Types$TypeRef$.apply(Types.scala:2401) at scala.reflect.internal.Types.typeRef(Types.scala:3553) at scala.reflect.internal.Types.typeRef$(Types.scala:3536) at scala.reflect.internal.SymbolTable.typeRef(SymbolTable.scala:16) at scala.reflect.internal.Symbols$TypeSymbol.newTypeRef(Symbols.scala:3026) at scala.reflect.internal.Symbols$TypeSymbol.updateTypeCache(Symbols.scala:3079) at scala.reflect.internal.Symbols$TypeSymbol.maybeUpdateTypeCache(Symbols.scala:3065) at scala.reflect.internal.Symbols$TypeSymbol.tpe_$times(Symbols.scala:3043) at scala.reflect.internal.Symbols$Symbol.typeOfThis(Symbols.scala:2020) at scala.reflect.internal.Types$ThisType.underlying(Types.scala:1184) at scala.reflect.internal.Types$SimpleTypeProxy.boundSyms(Types.scala:150) at scala.reflect.internal.Types$SimpleTypeProxy.boundSyms$(Types.scala:150) at scala.reflect.internal.Types$SingletonType.boundSyms(Types.scala:1088) at scala.reflect.internal.tpe.TypeMaps$SubstMap.apply(TypeMaps.scala:726) at scala.reflect.internal.tpe.TypeMaps$SubstSymMap.apply(TypeMaps.scala:789) at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:102) at scala.reflect.internal.tpe.TypeMaps$SubstSymMap.apply(TypeMaps.scala:783) at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:102) at scala.reflect.internal.tpe.TypeMaps$SubstSymMap.apply(TypeMaps.scala:783) at scala.reflect.internal.Types$Type.substSym(Types.scala:727) at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:123) at scala.reflect.internal.transform.UnCurry$$anon$1.apply(UnCurry.scala:53) at scala.reflect.internal.transform.UnCurry.transformInfo(UnCurry.scala:154) ``` This commit address the direct failure above by setting coherent flags on the stub package class symbol (it also needs the MODULE flag).
* | | | Merge pull request #5622 from edmundnoble/extra-errsAdriaan Moors2017-03-024-31/+66
|\ \ \ \ | | | | | | | | | | Improved error messages for identically named, differently prefixed types
| * | | | Match error lengthsEdmund Noble2017-02-071-2/+5
| | | | |
| * | | | Improved error messages for identically named, differently prefixed typesEdmund Noble2016-12-314-31/+63
| | | | |
* | | | | Merge pull request #5728 from Philippus/issue/html-tag-in-hoverLukas Rytz2017-03-023-17/+22
|\ \ \ \ \ | | |_|/ / | |/| | / | |_|_|/ |/| | | inlineToStr is not exhaustive and does not remove html tags inside HtmlTag [ci: last-only]
| * | | added missing Inline matches to inlineToStr so it is now exhaustivePhilippus Baalman2017-02-253-17/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scala.xml.XML.loadString(tag).text will remove all html tags inside the HtmlTag use a regex to remove html tags inside the tag added some tests for the inlineToStr-method moved inlineToStr to companion object of Page added test for nested html tags
* | | | SI-10207 Error before update conversionSom Snytt2017-02-261-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | Gaze deeper for errors before committing to conversion of assignment to update. The error buried in the transformed tree escapes notice of retypechecking and leaks to backend.
* | | | Merge pull request #5723 from dragos/issue/regression-assert-ideLukas Rytz2017-02-241-5/+10
|\ \ \ \ | | | | | | | | | | Fix regression introduced by 5751763
| * | | | Fix regression in 5751763Iulian Dragos2017-02-221-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | enterClass/Module may return an existing symbol, but in 5751763 the return value was dropped leading to assertion failures. This may show up only in the presentation compiler, which explains why it went unnoticed. Here's what needs to happen: - a class with a companion is loaded by the IDE, but the class name is different than the file name. This is from source - the same class and companion object exist as binary, and are loaded from classfiles when the package is completed (since they have different names than the source file, the classpath abstraction will only "know" that there is a classfile, and no corresponding source file) It seems that companionClass always prefers to return the companion defined in a source file, but if this assertion is called from the code path that tries to load the binary version, the newly created module will not match.
* | | | | Revert "Fix erasure of the qualifier of ##"Adriaan Moors2017-02-221-7/+6
| |/ / / |/| | |
* | | | Merge pull request #5681 from Philippus/issue/9704Lukas Rytz2017-02-221-3/+7
|\ \ \ \ | | | | | | | | | | SI-9704 don't add a closing HtmlTag if it is already closed
| * | | | moved Pattern and TagsNotToClose to a HtmlTag companion objectPhilippus Baalman2017-02-211-4/+6
| | | | |
| * | | | SI-9704 don't add a closed HtmlTag if it is already closedPhilippus Baalman2017-02-081-1/+3
| | | | |
* | | | | Revert "SI-10133 Require escaped single quote char lit"Adriaan Moors2017-02-214-40/+59
| | | | |
* | | | | Merge pull request #5663 from ↵Adriaan Moors2017-02-213-2/+8
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gourlaysama/ticket/sd-256-enable-repl-colors-unix-2 Enable colored output by default on unix Fix scala/scala-dev#256
| * | | | | SD-256 enable colored output by default on unixAntoine Gourlay2017-02-213-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `scala.color` now has 3 states: `true`, `false` and `auto` (the default). `auto` allows colors if not on windows and if the shell is interactive (as in, both stdin and stdout are a tty). The autodetect works as expected when run via SBT too, and it can always be overriden on the CLI or via JAVA_OPTS.
* | | | | | Merge pull request #5658 from retronym/topic/hashhashLukas Rytz2017-02-211-6/+7
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Fix erasure of the qualifier of ##
| * | | | | Fix erasure of the qualifier of ##Jason Zaugg2017-01-241-6/+7
| | | | | |
* | | | | | Merge pull request #5708 from szeiger/issue/si10194Lukas Rytz2017-02-211-7/+7
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-10194: Fix abstract type resolution for overloaded HOFs
| * | | | | | SI-10194: Fix abstract type resolution for overloaded HOFsStefan Zeiger2017-02-211-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Types in the applicable overload alternatives need to be seen from the respective owners of the individual alternative, not from the target’s owner (which can be a subtype of the types that define the methods).
* | | | | | | Merge pull request #5700 from retronym/ticket/10154-refactorLukas Rytz2017-02-213-39/+43
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Refactor lookupCompanion
| * | | | | | | Refactor implementation of lookupCompanionJason Zaugg2017-02-193-39/+43
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | - Check for module class up front to use sourceModule - Consolidate most of the logic in Contexts
* | | | | | | Merge pull request #5704 from som-snytt/issue/10190-elide-stringLukas Rytz2017-02-211-2/+6
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-10190 Elide string to empty instead of null
| * | | | | | | SI-10190 Elide string to empty instead of nullSom Snytt2017-02-151-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid NPE when eliding string-valued functions. For example, `log(s"$cheap$expensive")` needn't print null. This is a natural and inexpensive way to elide strings.
* | | | | | | | Merge pull request #5640 from optimizely/repl-import-handlerAdriaan Moors2017-02-204-19/+41
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-9881 Fix ImportHandler's reporting of importedNames and importedSymbols
| * | | | | | | | Fix ImportHandler's reporting of importedNames and importedSymbolsHao Xia2017-01-113-17/+37
| | | | | | | | |
| * | | | | | | | Fix SIOOBE in Name#pos for substrings of length 1Jason Zaugg2017-01-101-2/+4
| | | | | | | | |
* | | | | | | | | Merge pull request #5629 from som-snytt/issue/10120-quote-errAdriaan Moors2017-02-204-59/+40
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-10133 Require escaped single quote char lit
| * | | | | | | | | SI-10120 ReplReporter handles message indentSom Snytt2017-01-183-53/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of indenting source code to make messages align on output, let the reporter add indentation, only if the source is the console (and not a pastie or a loaded file). Previously, syntax errors were not indented. ``` $ skala Welcome to Scala 2.12.2-20170108-010722-939abf1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111). Type in expressions for evaluation. Or try :help. scala> 'abc' <console>:1: error: unclosed character literal (or use " for string literal "abc") 'abc' ^ scala> :quit $ scala Welcome to Scala 2.12.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111). Type in expressions for evaluation. Or try :help. scala> 'abc' <console>:1: error: unclosed character literal 'abc' ^ ```
| * | | | | | | | | SI-10120 Extra advice on unclosed char literalSom Snytt2017-01-081-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Folks from other languages might mistakenly enclose a string in single quotes. Since this presents as a symbol literal followed by the unpaired single quote, we can add a syntax reminder. Also polish the wording for bad string interpolation.
| * | | | | | | | | SI-10133 Require escaped single quote char litSom Snytt2017-01-081-0/+5
| | |_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The spec specifically requires `'\''` and not `'''`. The error consumes all consecutive single quotes.
* | | | | | | | | Merge pull request #5659 from retronym/ticket/10026Adriaan Moors2017-02-202-6/+10
|\ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|_|/ |/| | | | | | | | SI-10026 Fix endless cycle in runtime reflection
| * | | | | | | | SI-10026 Fix endless cycle in runtime reflectionJason Zaugg2017-02-192-6/+10
| | |_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 56f23af introduced a call to `baseTypeSeq` of `scala.collection.mutable.ArrayOps.ofRef[?T]{}` in `findMember`. This exposed a latent bug in the synchronized wrapper of `BaseTypeSeq`, demonstrated below with an older version of Scala: ``` Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_112). Type in expressions for evaluation. Or try :help. scala> val symtab = reflect.runtime.universe.asInstanceOf[scala.reflect.internal.SymbolTable] symtab: scala.reflect.internal.SymbolTable = scala.reflect.runtime.JavaUniverse@458544e0 scala> import symtab._ import symtab._ scala> val ArrayOps_ofRef_Class = symtab.symbolOf[scala.collection.mutable.ArrayOps.ofRef[AnyRef]] ArrayOps_ofRef_Class: symtab.TypeSymbol = class ofRef scala> appliedType(symbolOf[Set[Any]], symbolOf[Set[Any]].typeParams.map(TypeVar(_))) res2: symtab.Type = Set[?A] scala> .narrow res3: symtab.Type = <none>.<refinement>.type scala> .baseTypeSeq java.lang.StackOverflowError at scala.reflect.runtime.Gil$class.gilSynchronized(Gil.scala:21) at scala.reflect.runtime.JavaUniverse.gilSynchronized(JavaUniverse.scala:16) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$class.map(SynchronizedOps.scala:27) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.map(SynchronizedOps.scala:34) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$class.lateMap(SynchronizedOps.scala:34) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.lateMap(SynchronizedOps.scala:34) at scala.reflect.internal.BaseTypeSeqs$MappedBaseTypeSeq.map(BaseTypeSeqs.scala:235) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.scala$reflect$runtime$SynchronizedOps$SynchronizedBaseTypeSeq$$super$map(SynchronizedOps.scala:34) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anonfun$map$1.apply(SynchronizedOps.scala:27) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anonfun$map$1.apply(SynchronizedOps.scala:27) at scala.reflect.runtime.Gil$class.gilSynchronized(Gil.scala:19) at scala.reflect.runtime.JavaUniverse.gilSynchronized(JavaUniverse.scala:16) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$class.map(SynchronizedOps.scala:27) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.map(SynchronizedOps.scala:34) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$class.lateMap(SynchronizedOps.scala:34) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.lateMap(SynchronizedOps.scala:34) at scala.reflect.internal.BaseTypeSeqs$MappedBaseTypeSeq.map(BaseTypeSeqs.scala:235) ``` The infinite cycle involves: ``` class MappedBaseTypeSeq(orig: BaseTypeSeq, f: Type => Type) extends BaseTypeSeq(orig.parents map f, orig.elems) { ... override def map(g: Type => Type) = lateMap(g) override def lateMap(g: Type => Type) = orig.lateMap(x => g(f(x))) } trait SynchronizedBaseTypeSeq extends BaseTypeSeq { ... override def map(f: Type => Type): BaseTypeSeq = gilSynchronized { super.map(f) } override def lateMap(f: Type => Type): BaseTypeSeq = // only need to synchronize BaseTypeSeqs if they contain refined types if (map(f).toList.exists(_.isInstanceOf[RefinedType])) new MappedBaseTypeSeq(this, f) with SynchronizedBaseTypeSeq else new MappedBaseTypeSeq(this, f) } ``` This commit creates a new factory method for `MappedBaseTypeSeq`-s to break the cycle. As an independent change, I have also removed the attempt to conditionally synchronize them, as the condition was eagerly applying the map function (and throwing away the result!). I've appeased MiMa with new whitelist entries, but I'm confident that this is deep enough in the bowels of our runtime reflection implementation that there is no way that user code will be calling these methods directly.
* | | | | | | | Merge pull request #5707 from retronym/topic/java9-prepareLukas Rytz2017-02-202-2/+2
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | More groundwork for JDK 9 support