Skip to content

Commit 67699a2

Browse files
authored
Merge branch 'scala:main' into main
2 parents 1cf9b12 + 77481a7 commit 67699a2

File tree

4 files changed

+36
-11
lines changed

4 files changed

+36
-11
lines changed

_overviews/scala-book/sbt-scalatest-bdd.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ Next, create a file named *MathUtilsTests.scala* in the *src/test/scala/simplete
4545
```scala
4646
package simpletest
4747

48-
import org.scalatest.FunSpec
48+
import org.scalatest.funspec.AnyFunSpec
4949

50-
class MathUtilsSpec extends FunSpec {
50+
class MathUtilsSpec extends AnyFunSpec {
5151

5252
describe("MathUtils::double") {
5353

_sips/sips/binary-integer-literals.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
layout: sip
3+
title: SIP-42 - Support Binary Integer Literals
4+
stage: implementation
5+
status: waiting-for-implementation
6+
permalink: /sips/:title.html
7+
---
8+
9+
**By: NthPortal**
10+
11+
## History
12+
13+
| Date | Version |
14+
|---------------|--------------------------|
15+
| Jul 27th 2019 | Initial Draft |
16+
17+
Your feedback is welcome! If you're interested in discussing this proposal, head over to [this](https://contributors.scala-lang.org/t/pre-sip-binary-literals/3559) Scala Contributors thread and let me know what you think.
18+
19+
## Proposal
20+
21+
Support binary integer literals. For example, the binary literal `0b00101010` would have the integer value `42`.
22+
23+
## Motivation
24+
25+
Several other major languages support binary integer literals, including [Java](https://docs.oracle.com/javase/specs/jls/se12/html/jls-3.html#jls-3.10.1) (as of [Java 7](https://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.10.1)), [Kotlin](https://kotlinlang.org/docs/reference/basic-types.html#literal-constants), [Python](https://docs.python.org/3/reference/lexical_analysis.html#integer-literals) and [Rust](https://doc.rust-lang.org/stable/reference/tokens.html#number-literals).
26+
27+
## Interactions with Other Language Features
28+
29+
Like other integer literals, binary integer literals support separators (`_`), which can greatly enhance the readability of larger values (e.g. `0b_1110_1101_1011_0111`).
30+
31+
## Implementation
32+
33+
The implementation of binary integer literals is quite simple, and can be found at <https://github.com/scala/scala/pull/8275>.

_sips/sips/support-binary-integer-literals.md

-8
This file was deleted.

_tour/variances.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ We've seen we can accomplish covariance by making sure that we can't put somethi
116116

117117
We say that `Serializer` is *contravariant* in `A`, and this is indicated by the `-` before the `A`. A more general serializer is a subtype of a more specific serializer.
118118

119-
More formally, that gives us the reverse relationship: given some `class Contra[-T]`, then if `A` is a subtype of `B`, `Cov[B]` is a subtype of `Cov[A]`.
119+
More formally, that gives us the reverse relationship: given some `class Contra[-T]`, then if `A` is a subtype of `B`, `Contra[B]` is a subtype of `Contra[A]`.
120120

121121
### Comparison With Other Languages
122122

0 commit comments

Comments
 (0)