| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
SI-9572 Check for illegal tuple sizes in the parser
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
|
|
|
|
| |
Calling `wrap` or one of the higher-dimension Array factory methods on
the `Manifest` for `Unit` led to an exception because it tried to use
`void` as a primitive type. Unlike all other primitive Scala types,
`Unit` needs to be boxed. The basic `newArray` method was not affected
by this bug because it was already special-cased. The fix is to also
special-case `arrayClass`.
|
|\
| |
| | |
Trim complexity in CommentFactoryBase
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
1. Replace option handling with library call
2. Remove NumberFormatException catch presumed to be copy/paste legacy
3. It's Scaladoc
4. Parse trailing whitespace regex once instead of per line
5. Use string interpolation where it improves readability
6. Add missed alternative to block grammar production rule
7. Add regression test for tag requirement warnings
|
|/ |
|
|\
| |
| | |
[backport] SI-9616 False positive in unused import warning
|
| |
| |
| |
| | |
This is a minimal backport of the fix for SI-9383.
|
| |
| |
| |
| | |
The the word 'the' is often used twice. Fix that.
|
|\ \
| | |
| | | |
Fix Scaladoc overloaded method link to Duration companion object
|
| |/
| |
| |
| |
| |
| | |
The links were being skipped with a warning before this commit.
The key change was to remove the result type and add an asterisk.
|
|\ \
| | |
| | | |
SI-9605 Searching does not use binary search for Array
|
| |/
| |
| |
| | |
Binary search should be used for every `IndexedSeqLike` instance and not only for `IndexedSeq`. According the Scaladoc, it is `IndexedSeqLike` that guarantees "constant-time or near constant-time element access and length computation".
|
|/
|
|
|
| |
Docs for >> operation of integer types (from Byte to Long) had a wrong
direction saying that it is bit-shift left.
|
|\
| |
| | |
SI-9567 Fix pattern match on 23+ param, method local case class
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Under -optimize, the pattern matcher tries to avoid local variables
in favour of directly accessing to non-var case class accessors.
However, the code that analysed the patterns failed to account
properly for repeated parameters, which could either lead to
a compiler crash (when assuming that the n-th subpattern must have
a corresponding param accessor), or could lead to a correctness
problem (when failing to eagerly the bound elements from the
sequence.)
The test case that tried to cover seems only to have been working
because of a separate bug (the primary subject of SI-9567) related
to method-local case classes: they were treated during typechecking
as extractors, rather than native case classes.
The subsequent commit will fix that problem, but first we must
pave the way with this commit that emits local vals for bound
elements of case class repeated params.
|
|\ \
| | |
| | | |
Document JavaConverters conversion from java.util.Properties to Map
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Also
- Fix grammar on duplicated DecorateAsJava comment by copying over from
JavaConverters
- Remove author tags
|
|\ \ \
| | | |
| | | | |
add doc for log, sqrt
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
It's useful to know that log is the natural logarithm, not 10log or 2log or so.
Also did sqrt "while I was at it"
|
| | | |
| | | |
| | | |
| | | |
| | | | |
The alternative choice was to change "Hide All" to "Hide all" to match existing
capitalization but title case fits for this UI.
|
| |/ /
|/| |
| | |
| | |
| | |
| | | |
Fixes the index/length comparison in `Vector#take` and `Vector#drop` so that they handle all possible integer values.
Given the collection's invariants `startIndex >= endIndex` and `0 >= startIndex, endIndex`, it is sufficient to change the arithmetic in the comparison as done in this commit to avoid overflows. As cases when `n <= 0` are handled beforehand, `endIndex - n` cannot overflow, contrary to `startIndex + n`. If without the danger of overflows the condition yields true, on the other hand, `startIndex + n` cannot overflow as it is smaller than `endIndex` (as the previous formulation of the condition shows).
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fix a batch of code inspection recommendations generated by IntelliJ 14.1.5.
Categories of fix,
Unnecessary public modifier in interface
Replace filter+size with count
Replace filter+nonEmpty with exists
Replace filter+headOption with find
Replace `if (x != null) Some(x) else None` with Option(x)
Replace getOrElse null with orNull
Drop redundant semicolons
Replace anon fun with PF
Replace anon fun with method
|
|\ \
| | |
| | | |
Create a full Scala distribution from sbt
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- ManMaker is compiled in a new subproject “manual”. A simple command
line runner complements the ant task so that it can be run from sbt.
- Another new subproject “scala-dist” is responsible for building
the scala-dist.jar artifact.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
janekdb/2.11.x-scaladoc-fix-one-off-dot-restart-note
Align DotRunner dot restart count with command option description
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is the command option description,
val docDiagramsDotRestart = IntSetting(
"-diagrams-dot-restart",
"The number of times to restart a malfunctioning dot process before disabling diagrams (default: 5)",
5,
None,
_ => None
)
Prior to this change dot was restarted four times instead of five. Maybe the
intention of the option was to allow a total number of attempts to be specified
but with 5 restarts we need 6 attempts. The local var was renamed to reflect this.
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
janekdb/2.11.x-remove-lagged-scaladoc-setttings-notes
Remove notes about -doc-title and -doc-version not being used
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Confirmed these options are used by editing build-ant-macros.xml and viewing
the output,
<scaladoc docRootContent="${src.dir}/@{project}/${@{project}.docroot}"
destdir="${build-docs.dir}/@{project}"
- doctitle="${@{project}.description}"
+ doctitle="${@{project}.description} - test-title"
docfooter="epfl"
- docversion="${version.number}"
+ docversion="${version.number} - test-version"
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
janekdb/2.11.x-add-missing-scaladoc-commands-to-help-output
Add two missed scaladoc commands into scaladoc specific help section
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Prior to this change these scaladoc options were buried in the scalac section
of the help text,
-doc-external-doc
-implicits-sound-shadowing
With this change the options are listed in the scaladoc section.
This will make the commands easier to discover.
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
janekdb/2.11.x-scaladoc-excluded-classnames-more-data-like
Refactor excluded qname test to be more data like
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This refactoring extracts data from code into a form which is closer to
configuration data.
This is a step change toward making this configurable.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The Performance section got sucked into a wormhole and popped up in the
example tag. The laws of physics differ in the attributes block resulting
in the loss of the line break between the Time and Space paragraphs.
Fixed by moving the section out of the example tag.
|
|\ \ \
| | | |
| | | | |
Attacking exponential complexity in TypeMaps
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- Don't normalize existentials during the `contain`-s type map;
`ExistentialType#normalize' calls contains internally and
an exponential blowup ensues.
- Ensure that the type map used in variance validation never
returns modified types in order to avoid needless cloning of
symbols.
The enclosed test case still gets stuck in Uncurry, thanks to
the way that `TypeMap#mapOver(List[Symbol])` recurses through the
type first to check whether the type map would be an no-op or not.
If not, it repeats the type map with cloned symbols. Doing the work
twice at each level of recursion blows up the complexity.
Removing that "fast path" allows the enclosed test to compile
completely. As at this commit, it gets stuck in uncurry, which
dealiases `s.List` to `s.c.i.List` within the type.
Some more background on the troublesome part of `TypeMap`:
http://lrytz.github.io/scala-aladdin-bugtracker/displayItem.do%3Fid=1210.html
https://github.com/scala/scala/commit/f8b2b21050e7a2ca0f537ef70e3e0c8eead43abc
|
|\ \ \
| |_|/
|/| | |
less confusing wording for a dependent method type error
|
| |/
| |
| |
| |
| |
| |
| |
| | |
note to reviewers: the error messages in this file are over the place
about whether they're called "parameter sections", or "argument
lists", or what, so there's no point in being picky about that here
for context see SI-823
|
|\ \
| | |
| | | |
Improvements to the sbt build
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Reusing parts of #4593, this commits adds two additional subprojects to
the sbt build:
- repl-jline, which is already used by the ant build, builds the part of
the REPL that depends on JLine. The actual JLine depenency is moved to
this project.
- repl-jline-shaded uses JarJar to create a shaded version of repl-jline
and jline.jar.
Unlike the ant build, this setup does not use any circular dependencies.
dist/mkBin puts all of quick/repl, quick/repl-jline and
quick/repl-jline-shaded onto the classpath of build-sbt/quick/bin/scala.
A future addition to the sbt build for building build-sbt/pack will have
to put the generated classfiles into the correct JARs, mirroring the old
structure.
|
|\ \
| | |
| | | |
Multi output problem with delambdafied compilation
|
| | |
| | |
| | |
| | |
| | | |
This source is then used to figure out output folder for
compilation product.
|
| | | |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
User code compilation with -Ybackend:GenBCode -Ydelambdafy:method
fails for projects with multiple output directories.
The problem has its root in a fact that some `lambdaClass` symbols
the `associatedFile` field is not set. It can be done in Delambdafy.scala
(`makeAnonymousClass` method) and is working for following lambda
examples:
{{{
package acme
object Delambdafy {
type -->[D, I] = PartialFunction[D, I]
def main(args: Array[String]): Unit = {
val result = List(1, 2, 4).map { a =>
val list = List("1", "2", "3").map { _ + "test" }
list.find { _ == a.toString + "test" }
}
lazy val _foo = foo(result) {
case x::xs if x isDefined => x.get.length
case _ => 0
}
lazy val bar: Int => Int = {
case 2 => 13
case _ =>
val v = List(1).map(_ + 42).head
v + 1
}
}
def foo(b: List[Option[String]])(a: List[Option[String]] => Int): Int =
a(b)
}
}}}
but is NOT working for following lambda:
{{{
package acme
object Delambdafy {
type -->[D, I] = PartialFunction[D, I]
def main(args: Array[String]): Unit = {
lazy val _baz = baz {
case 1 =>
val local = List(1).map(_ + 1)
local.head
}
}
def baz[T](f: Any --> Any): Any => Any = f
}
}}}
so that's why source of compilation unit is used to determine output
directory in case when source file is not found for symbol.
|
|\ \
| | |
| | | |
it's Scaladoc, not ScalaDoc
|
| |/
| |
| |
| |
| | |
renaming the existing ScalaDoc and ScalaDocReporter classes might
break stuff, sadly, but at least we can fix the rest
|
|\ \
| | |
| | | |
SI-9497 Fix SetLike#clear() default implementation
|
| | |
| | |
| | |
| | | |
When dealing with mutable collections, it is not safe to assume iterators will remain consistent when the collection is modified mid-traversal. The bug reported in SI-9497 is very similar to SI-7269, "ConcurrentModificationException when filtering converted Java HashMap". Then, only the `retain` method was fixed. This commit fixes `clear`, which had the same problem.
|