You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 08-expressions.md
+9-12Lines changed: 9 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -51,12 +51,9 @@ discussed subsequently in decreasing order of precedence.
51
51
52
52
## Expression Typing
53
53
54
-
The typing of expressions is often relative to some _expected type_
55
-
(which might be undefined).
56
-
When we write ``expression $e$ is expected to conform to
57
-
type $T$'', we mean: (1) the expected type of $e$ is
58
-
$T$, and (2) the type of expression $e$ must conform to
59
-
$T$.
54
+
The typing of expressions is often relative to some _expected type_ (which might be undefined). When we write "expression $e$ is expected to conform to type $T$", we mean:
55
+
1. the expected type of $e$ is $T$, and
56
+
2. the type of expression $e$ must conform to $T$.
60
57
61
58
The following skolemization rule is applied universally for every
62
59
expression: If the type of an expression would be an existential type
@@ -91,14 +88,14 @@ which refers to a special “`null`” object. This object
91
88
implements methods in class `scala.AnyRef` as follows:
92
89
93
90
-`eq($x\,$)` and `==($x\,$)` return `true` iff the
94
-
argument $x$ is also the ``null'' object.
91
+
argument $x$ is also the "null" object.
95
92
-`ne($x\,$)` and `!=($x\,$)` return true iff the
96
-
argument x is not also the ``null'' object.
93
+
argument x is not also the "null" object.
97
94
-`isInstanceOf[$T\,$]` always returns `false`.
98
95
-`asInstanceOf[$T\,$]` returns the [default value](06-basic-declarations-and-definitions.html#value-declarations-and-definitions) of type $T$.
99
96
-`##` returns ``0``.
100
97
101
-
A reference to any other member of the ``null'' object causes a
98
+
A reference to any other member of the "null" object causes a
102
99
`NullPointerException` to be thrown.
103
100
104
101
@@ -1309,7 +1306,7 @@ syntax. Each of these is equivalent to the anonymous function on its right.
1309
1306
## Constant Expressions
1310
1307
1311
1308
Constant expressions are expressions that the Scala compiler can evaluate to a constant.
1312
-
The definition of ``constant expression'' depends on the platform, but they
1309
+
The definition of "constant expression" depends on the platform, but they
1313
1310
include at least the expressions of the following forms:
1314
1311
1315
1312
- A literal of a value class, such as an integer
@@ -1484,8 +1481,8 @@ single applicable alternative, that alternative is chosen. Otherwise, let $\math
1484
1481
be the set of applicable alternatives which don't employ any default argument
1485
1482
in the application to $e_1 , \ldots , e_m$. It is again an error if $\mathscr{CC}$ is empty.
1486
1483
Otherwise, one chooses the _most specific_ alternative among the alternatives
1487
-
in $\mathscr{CC}$, according to the following definition of being ``as specific as'', and
1488
-
``more specific than'':
1484
+
in $\mathscr{CC}$, according to the following definition of being "as specific as", and
0 commit comments