summaryrefslogtreecommitdiff
path: root/spec/06-expressions.md
Commit message (Collapse)AuthorAgeFilesLines
* fix typosSeth Tisue2017-03-201-1/+1
|
* SI-5621 Missing implicits are supplied by defaultsSom Snytt2017-03-101-2/+2
| | | | Make a note in the examples for default args.
* Add language to code blocks in spec (#5502)Daniel Barclay2016-11-161-5/+5
| | | | | | | | | | | | | | | * Add "scala" language code to pure-Scala code blocks. * Add "java" language code to Java code block. * Add "scala" language code to almost-pure-Scala code blocks. Add "scala" language code to two code blocks whose content was Scala except for containing ellipses (\ldots). * Add "scala" language code to non-literal-Scala code blocks. Add "scala" language code to code blocks that contain Scala but also special elements, such as identifiers that are italicized or have prime marks (e.g., e′, e′′), ellipses (\ldots), etc.
* Fix two instances of ASCII `...' quoting to Unicode ‘...’ (to match others).Daniel Barclay2016-11-051-2/+2
|
* Merge pull request #5441 from dsbos/dsbos-SpecFixQuotesSeth Tisue2016-10-201-52/+52
|\ | | | | SI-9959: Change `...' to ‘...’ (Unicode quotes) in ENBF (per intent per README.md).
| * Change `...' to ‘...’ (Unicode quotes) in ENBF (per intent per README.md).Daniel Barclay2016-10-031-52/+52
| | | | | | | | Also added a missing closing quote in SimplePattern production involving StableId.
* | SI-9943 final/sealed class does not yield SAM typeAdriaan Moors2016-10-041-0/+1
|/ | | | | | | | | | | | | | | | | | | 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.
* Spec typo: hide source comment in rendered versionLukas Rytz2016-09-051-1/+3
|
* Merge pull request #5355 from dsbos/dsbos-SpecEditsAdriaan Moors2016-08-221-18/+18
|\ | | | | Italicize more defining occurrences of terms in Scala lang. spec.
| * Editorial: Italicized more defining occurrences of terms.Daniel Barclay2016-08-211-18/+18
| |
* | Propagate overloaded function type to expected arg typeAdriaan Moors2016-08-121-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | SAM conversion precedes implicit view application (as in dotty).Adriaan Moors2016-03-261-11/+11
| | | | | | | | | | | | | | | | 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).
* | Soften sam restrictionsAdriaan Moors2016-03-261-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Additional SAM restrictions identified by JasonAdriaan Moors2016-03-261-2/+5
| | | | | | | | | | Also test roundtripping serialization of a lambda that targets a SAM that's not FunctionN (it should make no difference).
* | Spec updates for Sammy.Adriaan Moors2016-03-261-129/+93
|/ | | | | | | | | - 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.
* Update number of subsections in Value ConversionsFrank S. Thomas2015-11-231-1/+1
|
* Fix typos in spec, docs and commentsMichał Pociecha2015-08-231-1/+1
|
* fix typokenji yoshida2015-05-281-1/+1
|
* spec: Remove obsolete rules related to scala.NotNullGuillaume Martres2015-04-281-4/+0
| | | | | These rules were removed in #2244 and scala.NotNull itself was deprecated.
* Spec improvementsSimon Ochsenreither2015-04-251-8/+8
|
* fix definition of TRY in the language specIkumi Shimizu2015-01-171-1/+1
|
* Merge pull request #4201 from mpociecha/fix-typos-in-docs-and-commentsGrzegorz Kossakowski2015-01-141-2/+2
|\ | | | | Fix many typos in docs and comments
| * Fix many typos in docs and commentsmpociecha2014-12-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Spec update for signature polymorphic methodsLukas Rytz2014-12-181-0/+13
|/
* Update 06-expressions.mdroberthoedicke2014-10-081-3/+3
| | | | Inserted two missing instances of the word "the". Corrected "invokeDynamic" to "applyDynamic".
* Particular formatting improvement in the specSom Snytt2014-09-191-1/+1
| | | | | | | | | | | | | | 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.
* spec: fix broken links and anchors, including examplesAntoine Gourlay2014-09-171-4/+4
| | | | | | | 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.
* spec: remove trailing whitespace everywhereAntoine Gourlay2014-09-171-142/+103
|
* spec: fix latex formatting all over the placeAntoine Gourlay2014-09-171-16/+16
| | | | | | | | | 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`.
* SI-6054 Modern eta-expansion examples that almost runSom Snytt2014-03-281-9/+8
| | | | | | | | | | 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).
* SI-6069 Preserve by-name during eta-expansionSom Snytt2014-03-281-0/+4
| | | | | | | | 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.
* Number files like chapters. Consolidate toc & preface.Adriaan Moors2014-03-281-0/+1811
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 ```