| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cannot subclass such a class. (Well, we could subclass a sealed
class in the same compilation unit. We ignore this for simplicity.)
This is a bit of a sneaky fix for this bug, but our hand
is pretty much forced by other constraints, in this intersection
of overload resolution involving built-in function types and SAMs,
and type inference for higher-order function literals (#5307).
Luckily, in this particular issue, the overloading clash seems
accidental. The `sealed` `<:<` class is not a SAM type as it
cannot be subclassed outside of `Predef`. For simplicity,
we don't consider where the SAM conversion occurs and exclude
all sealed classes from yielding SAM types.
Thanks to Miles for pointing out that `final` was missing in my
first iteration of this fix.
|
| |
|
|\
| |
| | |
Italicize more defining occurrences of terms in Scala lang. spec.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Infer missing parameter types for function literals passed
to higher-order overloaded methods by deriving the
expected argument type from the function types in the
overloaded method type's argument types.
This eases the pain caused by methods becoming overloaded
because SAM types and function types are compatible,
which used to disable parameter type inference because
for overload resolution arguments are typed without
expected type, while typedFunction needs the expected
type to infer missing parameter types for function literals.
It also aligns us with dotty. The special case for
function literals seems reasonable, as it has precedent,
and it just enables the special case in typing function
literals (derive the param types from the expected type).
Since this does change type inference, you can opt out
using the Scala 2.11 source level.
Fix scala/scala-dev#157
|
| |
| |
| |
| |
| |
| |
| |
| | |
This reflects the majority vote on the PR.
DSLs that need their implicit conversions to kick in instead of
SAM conversion, will have to make their target types not be SAM
types (e.g., by adding a second abstract method to them).
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some of the earlier proposals were too strongly linked to the
requirements of the Java 8 platform, which was problematic for
scala.js & friends.
Instead of ruling out SAM types that we can't compile to use
LambdaMetaFactory, expand those during compilation to anonymous
subclasses, instead of invokedynamic + LMF.
Also, self types rear their ugly heads again. Align `hasSelfType`
with the implementation suggested in `thisSym`'s docs.
|
| |
| |
| |
| |
| | |
Also test roundtripping serialization of a lambda that targets a
SAM that's not FunctionN (it should make no difference).
|
|/
|
|
|
|
|
|
|
| |
- Upgrade MathJax to 2.6. This fixes the vertical bar problem
on Chrome (https://github.com/mathjax/MathJax/issues/1300);
- Disambiguate link to Dynamic Selection;
- Consolidate type relations;
- Formatting, whitespace and linebreaks;
- SAM conversion.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
These rules were removed in #2244 and scala.NotNull itself was
deprecated.
|
| |
|
| |
|
|\
| |
| | |
Fix many typos in docs and comments
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit corrects many typos found in scaladocs, comments and
documentation. It should reduce a bit number of PRs which fix one
typo.
There are no changes in the 'real' code except one corrected name of
a JUnit test method and some error messages in exceptions. In the case
of typos in other method or field names etc., I just skipped them.
Obviously this commit doesn't fix all existing typos. I just generated
in IntelliJ the list of potential typos and looked through it quickly.
|
|/ |
|
|
|
|
| |
Inserted two missing instances of the word "the".
Corrected "invokeDynamic" to "applyDynamic".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes the titularity of the "Overloading resolution" header
under 6.26.1 "Value conversions" to match "Type instantiation."
Hopefully this makes the link to the actual 6.26.3 overloading
resolution section work without further renaming. (Edit: changed
the minor heading to say "Static overload resolution", which is
sufficiently redundant.)
Possibly that is the oftenest-cited section of the entire document.
At least on Stack Overflow, if not in Proceedings of the ACM.
|
|
|
|
|
|
|
| |
For examples, the "name" of the example (like "Example Ordered") is only
used to derived its html id so that one can link to it (see
`layouts/default.yml`). Ideally all examples should have a name; here I
only added enough to satisfy existing links.
|
| |
|
|
|
|
|
|
|
|
|
| |
Two things worth mentioning:
- `\em` and `emph` are not supported by MathJax,
- and things like `\mathcal{C}_0` require escaping the `_`,
otherwise markdown sees it as the beginning of `_some string_`.
It doesn't happen without the closing bracket in front, e.g. in `b_0`.
|
|
|
|
|
|
|
|
|
|
| |
This wasn't so easy after all. The clever one is to show
that `Option.fold(=>Z)` preserves the by-nameness of the zero value,
which may or may not be in the spec yet.
The addition to 6.26.5 was (I think) rejected as implementation-specific;
it should use the wording from 6.6 about "preserving by-nameness" or "by-namity"
(the latter has the advantage of sounding both more technical and somewhat inane).
|
|
|
|
|
|
|
|
| |
This wording attempts to describe the behavior change in SI-5610
while remaining non-committal about the mechanism.
It refers to the section on function applications and attempts to
use similar language.
|
|
Aside from the consolidation of title & preface in index.md,
this commit was produced as follows:
```
cd spec/
g mv 03-lexical-syntax.md 01-lexical-syntax.md
g mv 04-identifiers-names-and-scopes.md 02-identifiers-names-and-scopes.md
g mv 05-types.md 03-types.md
g mv 06-basic-declarations-and-definitions.md 04-basic-declarations-and-definitions.md
g mv 07-classes-and-objects.md 05-classes-and-objects.md
g mv 08-expressions.md 06-expressions.md
g mv 09-implicit-parameters-and-views.md 07-implicit-parameters-and-views.md
g mv 10-pattern-matching.md 08-pattern-matching.md
g mv 11-top-level-definitions.md 09-top-level-definitions.md
g mv 12-xml-expressions-and-patterns.md 10-xml-expressions-and-patterns.md
g mv 13-user-defined-annotations.md 11-user-defined-annotations.md
g mv 14-the-scala-standard-library.md 12-the-scala-standard-library.md
g mv 15-syntax-summary.md 13-syntax-summary.md
g mv 16-references.md 14-references.md
perl -pi -e 's/03-lexical-syntax/01-lexical-syntax/g' *.md
perl -pi -e 's/04-identifiers-names-and-scopes/02-identifiers-names-and-scopes/g' *.md
perl -pi -e 's/05-types/03-types/g' *.md
perl -pi -e 's/06-basic-declarations-and-definitions/04-basic-declarations-and-definitions/g' *.md
perl -pi -e 's/07-classes-and-objects/05-classes-and-objects/g' *.md
perl -pi -e 's/08-expressions/06-expressions/g' *.md
perl -pi -e 's/09-implicit-parameters-and-views/07-implicit-parameters-and-views/g' *.md
perl -pi -e 's/10-pattern-matching/08-pattern-matching/g' *.md
perl -pi -e 's/11-top-level-definitions/09-top-level-definitions/g' *.md
perl -pi -e 's/12-xml-expressions-and-patterns/10-xml-expressions-and-patterns/g' *.md
perl -pi -e 's/13-user-defined-annotations/11-user-defined-annotations/g' *.md
perl -pi -e 's/14-the-scala-standard-library/12-the-scala-standard-library/g' *.md
perl -pi -e 's/15-syntax-summary/13-syntax-summary/g' *.md
perl -pi -e 's/16-references/14-references/g' *.md
```
|