summaryrefslogtreecommitdiff
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* Merge 2.11.x into 2.12.xAdriaan Moors2017-04-131-1/+1
|\ | | | | | | MathJax CDN update
| * MathJax CDN change and version bumpAdriaan Moors2017-04-101-1/+1
| | | | | | | | https://www.mathjax.org/cdn-shutting-down/
| * Improvements based on reviews by Lukas & JasonAdriaan Moors2017-03-021-3/+2
| |
| * Clarify spec of interaction of existing vs synthetic apply/unapplyAdriaan Moors2017-02-281-11/+10
| | | | | | | | | | When matching user-defined apply/unapply members exist in a case class's companion object, don't add clashing synthetic ones.
* | Merge pull request #5816 from adriaanm/userdefined-apply-212Adriaan Moors2017-04-101-11/+9
|\ \ | | | | | | Allow user-defined `[un]apply` in case companion
| * | Improvements based on reviews by Lukas & JasonAdriaan Moors2017-04-061-3/+2
| | |
| * | Clarify spec of interaction of existing vs synthetic apply/unapplyAdriaan Moors2017-04-061-11/+10
| | | | | | | | | | | | | | | When matching user-defined apply/unapply members exist in a case class's companion object, don't add clashing synthetic ones.
* | | Fix == in spec linearization examplesJanek Bogucki2017-04-104-10/+15
|/ / | | | | | | | | | | | | Also - Consistify trailing punctuation - Use whitespace to group linearization examples
* | fix typosSeth Tisue2017-03-201-1/+1
| |
* | SI-5621 Missing implicits are supplied by defaultsSom Snytt2017-03-102-2/+11
| | | | | | | | Make a note in the examples for default args.
* | GH-644: Remove static html styling of spec code blocksJanek Bogucki2017-02-231-1/+1
| | | | | | | | | | | | | | | | Prior to this Jekyll configuration change code blocks were being marked up in a ways that disrupted MathJax styling. Tested as far a possible locally. Confidence mainly drawn from html comparison to working 2.11.x version.
* | Merge pull request #5660 from som-snytt/issue/9464-specAdriaan Moors2017-02-201-4/+6
|\ \ | | | | | | SI-9464 Clarify spec on no final trait
| * | SI-9464 Clarify spec on no final traitSom Snytt2017-01-241-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without being too finicky with syntax, say that `final abstract class` is OK (even as a nested class, where it would be an incomplete member) but not `final trait`. Such a class might be a standard lib primitive, or might be an implicit value that is only a ludicrous marker and, if present, need only have the null value.
* | | GH-644: Expand note regarding Jekyll versionsJanek Bogucki2017-02-171-1/+5
| | |
* | | Merge pull request #5585 from som-snytt/issue/10097Adriaan Moors2017-02-071-6/+7
|\ \ \ | |/ / |/| | SI-10097 Error if no non-implicit case class param
| * | SI-10097 Error if no non-implicit case class paramSom Snytt2016-12-141-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Case class must have a non-implicit param list. Error early, error often. Also update spec to say that class implicitly gets a non-implicit parameter section if it doesn't have one, and that a case class must have one.
* | | Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2016-12-202-5/+5
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | | | merge/2.11.x-to-2.12.x-20161220 Conflicts: bincompat-backward.whitelist.conf build.xml src/compiler/scala/tools/nsc/typechecker/Typers.scala src/library/scala/collection/immutable/NumericRange.scala
| * Merge pull request #5605 from szeiger/wip/fix-07-linksAdriaan Moors2016-12-192-4/+4
| |\ | | | | | | Fix spec links to `07-implicits.html`
| | * Fix spec links to `07-implicits.html`Stefan Zeiger2016-12-182-4/+4
| | | | | | | | | | | | | | | The file referenced by the current links actually exists under http://www.scala-lang.org/files/archive/spec/2.11/ but with a different design than the rest. It seems to be left over from an older version.
| * | fix eBNF error by removing wrong closing braceptrcarta2016-12-021-1/+1
| | |
| * | Update to mathjax 2.6-latest [2.12.x backport]Adriaan Moors2016-11-291-1/+1
| | | | | | | | | | | | This fixes the vertical bar problem on Chrome (https://github.com/mathjax/MathJax/issues/1300);
* | | Merge pull request #5407 from som-snytt/issue/9557Adriaan Moors2016-11-292-2/+2
|\ \ \ | | | | | | | | SI-9557 Backquoted id spec
| * | | SI-9557 Backquoted id specSom Snytt2016-11-152-2/+2
| | | |
* | | | Merge commit '57290a1' into topic/merge-2.11.x-to-2.12.x-20161129Jason Zaugg2016-11-291-2/+2
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | Conflicts: spec/_layouts/default.yml test/junit/scala/tools/nsc/interpreter/CompletionTest.scala Fixes scala/scala-dev#272
| * | | Use https links to JS and CSS in the spec when serving from httpsStefan Zeiger2016-11-281-2/+2
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | The spec is published on a server that supports https (https://www.scala-lang.org/files/archive/spec/2.11/) and this comes up as the default in search results (as it should) but the link to MathJAX is hardcoded to http, which prevents any web browser that cares about security from loading it. This commit changes the links to MathJAX and to the Highlight.js stylesheet to be scheme-relative (like the link to JQuery already was).
* | | Add language to code blocks in spec (#5502)Daniel Barclay2016-11-166-20/+20
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Typo and spelling correctionsJanek Bogucki2016-11-111-2/+2
| |
* | Fix two instances of ASCII `...' quoting to Unicode ‘...’ (to match others).Daniel Barclay2016-11-051-2/+2
| |
* | Added U+hhhh values for quote characters to clarify.Daniel Barclay2016-11-051-2/+2
| |
* | assorted typo fixes, cleanup, updating of commentsSeth Tisue2016-10-241-1/+1
| | | | | | | | | | | | just in time for Halloween. "boostrap" is definitely the most adorable typo evah -- and one of the most common, too. but we don't want to scare anybody.
* | Merge pull request #5406 from dsbos/dsbos-SI-9924Seth Tisue2016-10-201-1/+1
|\ \ | | | | | | SI-9924: Fix: Spec. refers to U+007F (DELETE) as printable character
| * | SI-9924: Fix: Spec. refers to U+007F (DELETE) as printable characterDaniel Barclay2016-09-261-1/+1
| | | | | | | | | | | | | | | Fixed "\u0020 - \u007F" to "\u0020 - \u007E". (Also fixed/clarified punctuation and grammar.)
* | | Merge pull request #5441 from dsbos/dsbos-SpecFixQuotesSeth Tisue2016-10-205-111/+111
|\ \ \ | | | | | | | | SI-9959: Change `...' to ‘...’ (Unicode quotes) in ENBF (per intent per README.md).
| * | | Fixed some ‘...‘ (two open quotes) to ‘...’ (open vs. close quotes) ↵Daniel Barclay2016-10-031-2/+2
| | | | | | | | | | | | | | | | in ENBF.
| * | | Change `...' to ‘...’ (Unicode quotes) in ENBF (per intent per README.md).Daniel Barclay2016-10-035-109/+109
| |/ / | | | | | | | | | 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.
* | | Update keypair used to rsync spec to charaAdriaan Moors2016-09-291-15/+68
| | | | | | | | | | | | | | | | | | So that we can rsync to the 2.12 spec directory. (also updated the forced command in scalatest@chara.epfl.ch:~/.ssh/authorized_keys2)
* | | capitalize GitHub correctlySeth Tisue2016-09-292-2/+2
| | |
* | | bump version number in spec from 2.11 to 2.12Seth Tisue2016-09-293-4/+4
| | |
* | | make the 2.12 spec available on scala-lang.orgSeth Tisue2016-09-291-1/+1
|/ / | | | | | | reference: https://github.com/scala/scala-lang/issues/479
* | Spec typo: hide source comment in rendered versionLukas Rytz2016-09-051-1/+3
| |
* | Merge pull request #5355 from dsbos/dsbos-SpecEditsAdriaan Moors2016-08-227-54/+54
|\ \ | | | | | | Italicize more defining occurrences of terms in Scala lang. spec.
| * | Editorial: Italicized more defining occurrences of terms.Daniel Barclay2016-08-217-54/+54
| | |
* | | Fix typos in syntaxtomjridge2016-08-151-3/+3
| | |
* | | 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
* | | Fields phaseAdriaan Moors2016-08-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One step towards teasing apart the mixin phase, making each phase that adds members to traits responsible for mixing in those members into subclasses of said traits. Another design tenet is to not emit symbols or trees only to later remove them. Therefore, we model a val in a trait as its accessor. The underlying field is an implementation detail. It must be mixed into subclasses, but has no business in a trait (an interface). Also trying to reduce tree creation by changing less in subtrees during tree transforms. A lot of nice fixes fall out from this rework: - Correct bridges and more precise generic signatures for mixed in accessors, since they are now created before erasure. - Correct enclosing method attribute for classes nested in trait fields. Trait fields are now created as MethodSymbol (no longer TermSymbol). This symbol shows up in the `originalOwner` chain of a class declared within the field initializer. This promoted the field getter to being the enclosing method of the nested class, which it is not (the EnclosingMethod attribute is a source-level property). - Signature inference is now more similar between vals and defs - No more field for constant-typed vals, or mixed in accessors for subclasses. A constant val can be fully implemented in a trait. TODO: - give same treatment to trait lazy vals (only accessors, no fields) - remove support for presuper vals in traits (they don't have the right init semantics in traits anyway) - lambdalift should emit accessors for captured vals in traits, not a field Assorted notes from the full git history before squashing below. Unit-typed vals: don't suppress field it affects the memory model -- even a write of unit to a field is relevant... unit-typed lazy vals should never receive a field this need was unmasked by test/files/run/t7843-jsr223-service.scala, which no longer printed the output expected from the `0 to 10 foreach` Use getter.referenced to track traitsetter reify's toolbox compiler changes the name of the trait that owns the accessor between fields and constructors (`$` suffix), so that the trait setter cannot be found when doing mkAssign in constructors this could be solved by creating the mkAssign tree immediately during fields anyway, first experiment: use `referenced` now that fields runs closer to the constructors phase (I tried this before and something broke) Infer result type for `val`s, like we do for `def`s The lack of result type inference caused pos/t6780 to fail in the new field encoding for traits, as there is no separate accessor, and method synthesis computes the type signature based on the ValDef tree. This caused a cyclic error in implicit search, because now the implicit val's result type was not inferred from the super member, and inferring it from the RHS would cause implicit search to consider the member in question, so that a cycle is detected and type checking fails... Regardless of the new encoding, we should consistently infer result types for `def`s and `val`s. Removed test/files/run/t4287inferredMethodTypes.scala and test/files/presentation/t4287c, since they were relying on inferring argument types from "overridden" constructors in a test for range positions of default arguments. Constructors don't override, so that was a mis-feature of -Yinfer-argument-types. Had to slightly refactor test/files/presentation/doc, as it was relying on scalac inferring a big intersection type to approximate the anonymous class that's instantiated for `override lazy val analyzer`. Now that we infer `Global` as the expected type based on the overridden val, we make `getComment` private in navigating between good old Skylla and Charybdis. I'm not sure why we need this restriction for anonymous classes though; only structural calls are restricted in the way that we're trying to avoid. The old behavior is maintained nder -Xsource:2.11. Tests: - test/files/{pos,neg}/val_infer.scala - test/files/neg/val_sig_infer_match.scala - test/files/neg/val_sig_infer_struct.scala need NMT when inferring sig for accessor Q: why are we calling valDefSig and not methodSig? A: traits use defs for vals, but still use valDefSig... keep accessor and field info in synch
* | | SI-8044 Allow any id in explicit pattern bindingSom Snytt2016-05-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows arbitrary identifier in `X @ pat`, including non-varids. This goes to regularity. Users of this syntax are not likely to be confused by the "backquoted var id is stable" rule. Also for sequence pattern, `X @ _*`.
* | | SI-8044 Allow binding backquoted varid in patternsSom Snytt2016-05-202-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a varid could not be backquoted, so that it was not possible to introduce variables with names such as `type` in a match expression. This commit allows backquoted varids in `case x @ _` and `case x: Int`. In neither position is a stable id accepted, that is, an id with leading uppercase. Therefore, this commit merely relaxes the backquoted varid to be taken as a normal varid in these contexts.
* | | SI-2458 Clarify spec for package syms (#5151)som-snytt2016-05-171-37/+54
| | | | | | | | | | | | | | | Package definitions are priority 4. Update the big example to be cut/pastable.
* | | 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).