summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | 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
| * | | | | | | | Avoid ambiguous overload on JDK 9Jason Zaugg2017-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The addition of this method in `CharBuffer` CharBuffer position(int newPosition) renders an ambiguity in: ``` scala> (b: java.nio.CharBuffer) => b.position <console>:12: error: ambiguous reference to overloaded definition, both method position in class CharBuffer of type (x$1: Int)java.nio.CharBuffer and method position in class Buffer of type ()Int match expected type ? (b: java.nio.CharBuffer) => b.position ``` Manually applying the empty params avoids this.
| * | | | | | | | Adapt to change in ClassLoader in JDK 9Jason Zaugg2017-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A package protected method was added: Stream<Package> packages() The private accessor method for `val package` in our subclass now violates the "cannot tighten access" rule. Making it `private[this]` avoids creating an accessor.
* | | | | | | | | Merge pull request #5709 from adriaanm/sam_wild_boundLukas Rytz2017-02-201-0/+5
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Ignore BoundedWildcardType in erasure type map
| * | | | | | | | | Ignore BoundedWildcardType in erasure type mapAdriaan Moors2017-02-191-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This case can be triggered as illustrated in the test.
* | | | | | | | | | Merge pull request #5711 from retronym/ticket/jrtLukas Rytz2017-02-202-30/+58
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Faster and simpler Java 9 classpath implementation
| * | | | | | | | | | Faster and simpler Java 9 classpath implementationJason Zaugg2017-02-172-30/+58
| | |/ / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Take advantage of the `/packages` index provided by the jrt file system to avoid (expensive) Files.exist for non-existent entries across the full list of modules. - Extends ClassPath directly which leads to a simpler implemnentation that using the base class. - Add a unit test that shows we can read classes and packages from the Java standard library. Fixes scala/scala-dev#306 With this change bootstrap time under Java 9 was comparable to Java 8. Before, it was about 40% slower.
* | | | | | | | | | Merge pull request #5714 from dragos/issue/usage-sterr-SI-10178Lukas Rytz2017-02-201-2/+10
|\ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / |/| | | | | | | | | SI-10178 Route reporter.echo to stdout
| * | | | | | | | | SI-10178 Route reporter.echo to stdoutIulian Dragos2017-02-181-2/+10
| | |_|_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `echo` is currently used only for usage information, and that makes a lot more sense to go to stdout instead of stderr. This allows grepping through the extensive list of compiler options.
* | | | | | | | | SI-10148 Accept verbose zeroSom Snytt2017-02-181-4/+4
| |_|/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | The test for non-zero must recognize `-0e+00f` and variants.
* | | | | | | | Merge pull request #5710 from SethTisue/sd-303Adriaan Moors2017-02-171-3/+7
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | fix recent regression: macro paradise + Java sources = MatchError
| * | | | | | | | fix recent regression: macro paradise + Java sources = MatchErrorSeth Tisue2017-02-171-3/+7
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes https://github.com/scala/scala-dev/issues/303 ; the regression was in https://github.com/scala/scala/pull/5585
* | | | | | | | Merge branch '2.12.x' into merge-2.11.x-to-2.12.x-20170214Seth Tisue2017-02-1760-186/+285
|\| | | | | | |
| * | | | | | | Merge pull request #5693 from markusjura/lineStream-warningsSeth Tisue2017-02-171-2/+2
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Changing deprecation warning to lineStream
| | * | | | | | | Changing deprecation warning to lineStreamMarkus Jura2017-02-131-2/+2
| | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The deprecation text of `ProcessBuilder.lines(log: ProcessLogger)` and `ProcessBuilder.lines_!(log: ProcessLogger) mentions to use the method `stream` and `stream_!` respectively. These methods do not exists. The text has been changed to use `lineStream` and `lineStream_!` respectively.
| * | | | | | | Merge pull request #5697 from som-snytt/issue/10164Seth Tisue2017-02-171-8/+8
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-10164 BitSet.tail zigs where it zagged
| | * | | | | | | SI-10164 BitSet.tail zigs where it zaggedSom Snytt2017-02-141-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A cut/paste issue, an increment was held over from head, which scans forward, to tail, which scans backward.
| * | | | | | | | Merge pull request #5694 from ↵Seth Tisue2017-02-1642-65/+66
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | janekdb/topic/2.12.x-scaladoc-spelling-corrections-2 Fix typos in compiler and reflect
| | * | | | | | | | Fix typos in compiler and reflectJanek Bogucki2017-02-1342-65/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Miscellania: Miscellania is a small island off the northernmost part of the Fremennik Isles - RunScape Wiki Miscellanea: A collection of miscellaneous objects or writings - Merriam-Webster
| * | | | | | | | | Merge pull request #5648 from som-snytt/issue/10148Seth Tisue2017-02-162-8/+30
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-10148 Follow Java for float literals
| | * | | | | | | | | SI-10148 Follow Java for float literalsSom Snytt2017-01-182-8/+30
| | | |_|_|_|/ / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use `Float.parseFloat` instead of converting from Double. Error when a value rounds to zero.
| * | | | | | | | | Merge pull request #5688 from Philippus/fix-scaladoc-base-referencesAdriaan Moors2017-02-162-3/+4
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | fixed broken references after move from 'model' to 'base'
| | * | | | | | | | | fixed broken references after move from 'model' to 'base'Philippus Baalman2017-02-102-3/+4
| | | |_|_|/ / / / / | | |/| | | | | | |
| * | | | | | | | | Merge pull request #5674 from Philippus/issue/9519Adriaan Moors2017-02-161-24/+0
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-9519 removed the usecase section of the ++-method
| | * | | | | | | | | SI-9519 removed the usecase section of the ++-methodPhilippus Baalman2017-02-041-24/+0
| | | |_|_|_|_|_|_|/ | | |/| | | | | | |
| * | | | | | | | | Merge pull request #5687 from retronym/ticket/10177Adriaan Moors2017-02-161-0/+27
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-10177 Override lazy operations to preserve TrieMap's semantics
| | * | | | | | | | | SI-10177 Override lazy operations to preserve TrieMap's semanticsJason Zaugg2017-02-101-0/+27
| | | |_|_|_|_|_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling .iterator on a TrieMap gives a read-only snapshot. This then extends to most inherited implementations written in terms of .iterator. However, some inherited methods, such as .values, either defer the call to .iterator or call it more than once. This results in subsequent mutations to the original map being visible I reviewed the inherited implementations from MapLike and found we needed overrides of `values`, `keySet`, `filterKeys`, and `mapValues`. Like `iterator`, these now create a read-only snapshot.
| * | | | | | | | | Merge pull request #5589 from allisonhb/feature/si-4700Adriaan Moors2017-02-165-2/+63
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-4700 The thrilling continuation to the infix type printing saga.
| | * | | | | | | | | SI-4700 Make infix notation default for symbolic types.allisonhb2016-12-143-22/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add ability to disable this via the @showAsInfix annotation.
| | * | | | | | | | | SI-4700 Show infix types with as few parentheses as needed.allisonhb2016-12-131-9/+21
| | | | | | | | | | |
| | * | | | | | | | | SI-4700 Add `@infix` annotation for type printingVlad Ureche2016-09-194-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` scala> import scala.annotation.infix import scala.annotation.infix scala> @infix class &&[T, U] defined class $amp$amp scala> def foo: Int && Boolean = ??? foo: Int && Boolean ```
| * | | | | | | | | | Merge pull request #5546 from som-snytt/issue/9636Adriaan Moors2017-02-161-32/+24
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | SI-9636 More precise error pos on apply inference
| | * | | | | | | | | | SI-9636 More precise error pos on apply inferenceSom Snytt2016-12-201-32/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a method type arg is inferred Any, warn about the function and not the innocent arg.
| * | | | | | | | | | | Merge pull request #5662 from teldosas/SI-9675Adriaan Moors2017-02-161-1/+1
| |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | SI-9675 warn about non-sensible equals in anonymous functions
| | * | | | | | | | | | | Add warning about non-sensible equals in anonymous functionsteldosas2017-02-011-1/+1
| | | |_|/ / / / / / / / | | |/| | | | | | | | |
| * | | | | | | | | | | Merge pull request #5679 from som-snytt/issue/sliding-docAdriaan Moors2017-02-162-30/+41
| |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | Nuance doc for sliding
| | * | | | | | | | | | | Nuance doc for slidingSom Snytt2017-02-072-30/+41
| | | |_|_|/ / / / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Attempt to clarify how final element is handled.