Skip to content

Commit 94fd2fd

Browse files
committed
Add TODOs for later, Cleanup
1 parent 135eab0 commit 94fd2fd

File tree

2 files changed

+4
-52
lines changed

2 files changed

+4
-52
lines changed

docs/_spec/03-types.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ StableId ::= id
6363
| [id ‘.’] ‘super’ [ClassQualifier] ‘.’ id
6464
ClassQualifier ::= ‘[’ id ‘]’
6565
```
66-
66+
<!-- TODO: Clarify paragraph -->
6767
Paths are not types themselves, but they can be a part of named types and in that function form a central role in Scala's type system.
6868

6969
A path is one of the following.
@@ -388,6 +388,7 @@ Method types associate to the right: ´(\mathit{Ps}\_1)(\mathit{Ps}\_2)U´ is tr
388388
A special case are types of methods without any parameters.
389389
They are written here `=> T`. Parameterless methods name expressions that are re-evaluated each time the parameterless method name is referenced.
390390

391+
<!-- TODO: replace by reference to eta-expansion instead -->
391392
Method types do not exist as types of values.
392393
If a method name is used as a value, its type is [implicitly converted](06-expressions.html#implicit-conversions) to a corresponding function type.
393394

@@ -642,20 +643,9 @@ A _weak least upper bound_ is a least upper bound with respect to weak conforman
642643
A type ´T´ is _compatible_ to a type ´U´ if ´T´ (or its corresponding function type) [weakly conforms](#weak-conformance) to ´U´ after applying [eta-expansion](06-expressions.html#eta-expansion).
643644
If ´T´ is a method type, it's converted to the corresponding function type.
644645
If the types do not weakly conform, the following alternatives are checked in order:
645-
- [view application](07-implicits.html#views): there's an implicit view from ´T´ to ´U´;
646646
- dropping by-name modifiers: if ´U´ is of the shape `´=> U'´` (and ´T´ is not), `´T <:_w U'´`;
647647
- SAM conversion: if ´T´ corresponds to a function type, and ´U´ declares a single abstract method whose type [corresponds](06-expressions.html#sam-conversion) to the function type ´U'´, `´T <:_w U'´`.
648-
649-
<!--- TODO: include other implicit conversions in addition to view application?
650-
651-
trait Proc { def go(x: Any): Unit }
652-
653-
def foo(x: Any => Unit): Unit = ???
654-
def foo(x: Proc): Unit = ???
655-
656-
foo((x: Any) => 1) // works when you drop either foo overload since value discarding is applied
657-
658-
-->
648+
- [implicit conversion](07-implicits.html#views): there's an implicit conversion from ´T´ to ´U´ in scope;
659649

660650
#### Examples
661651

docs/_spec/04-basic-declarations-and-definitions.md

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -40,53 +40,15 @@ by commas. These are expanded according to the following scheme:
4040
\VAL;x, y: T = e && \VAL; x: T = e \\
4141
&& \VAL; y: T = x \\[0.5em]
4242
43-
\LET;x, y: T = e && \LET; x: T = e \\
44-
&& \VAL; y: T = x \\[0.5em]
45-
46-
\DEF;x, y (ps): T = e &\tab\mbox{expands to}\tab& \DEF; x(ps): T = e \\
47-
&& \DEF; y(ps): T = x(ps)\\[0.5em]
48-
4943
\VAR;x, y: T := e && \VAR;x: T := e\\
5044
&& \VAR;y: T := x\\[0.5em]
51-
52-
\TYPE;t,u = T && \TYPE; t = T\\
53-
&& \TYPE; u = t\\[0.5em]
5445
\eda
5546
56-
All definitions have a ``repeated form`` where the initial
57-
definition keyword is followed by several constituent definitions
58-
which are separated by commas. A repeated definition is
59-
always interpreted as a sequence formed from the
60-
constituent definitions. E.g. the function definition
61-
`def f(x) = x, g(y) = y` expands to
62-
`def f(x) = x; def g(y) = y` and
63-
the type definition
64-
`type T, U <: B` expands to
65-
`type T; type U <: B`.
66-
}
67-
\comment{
68-
If an element in such a sequence introduces only the defined name,
69-
possibly with some type or value parameters, but leaves out any
70-
additional parts in the definition, then those parts are implicitly
71-
copied from the next subsequent sequence element which consists of
72-
more than just a defined name and parameters. Examples:
73-
74-
- []
7547
The variable declaration `var x, y: Int`
7648
expands to `var x: Int; var y: Int`.
77-
- []
49+
7850
The value definition `val x, y: Int = 1`
7951
expands to `val x: Int = 1; val y: Int = 1`.
80-
- []
81-
The class definition `case class X(), Y(n: Int) extends Z` expands to
82-
`case class X extends Z; case class Y(n: Int) extends Z`.
83-
- The object definition `case object Red, Green, Blue extends Color`~
84-
expands to
85-
```scala
86-
case object Red extends Color
87-
case object Green extends Color
88-
case object Blue extends Color
89-
```
9052
-->
9153

9254
## Value Declarations and Definitions

0 commit comments

Comments
 (0)