Skip to content

Commit 3e993d0

Browse files
committed
Restore blog post to original form
Was updated to new syntax by accident
1 parent 7561634 commit 3e993d0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

docs/blog/_posts/2019-11-04-20th-dotty-milestone-release.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,12 @@ It is now possible to specialize `inline given`s with the help of `<:` as follow
9696
trait A
9797
class B extends A
9898

99-
inline given wb as _ <: A = B()
99+
inline given tc <: A = B()
100100

101101
val x: B = summon[A]
102102
```
103-
In this example, the inline given `wb` will return a result of a subtype of the declared upper bound `A` as determined by `B`. In our terminology, `wb` is a whitebox macro. Contrast with the following definition of a blackbox given macro `bb`:
104-
```
105-
inline given bb as A = B()
106-
```
107-
Here, the type of `bb` will always be `A`, no matter what `B` returns.
103+
104+
This change brings `given`s even with the ordinary `inline def`s.
108105

109106
## Normal parameters can follow `given` parameters
110107
Previously normal parameters after `given` parameter was disallowed mainly because they looked awkward with the old syntax. With the syntax being improved, this restriction is now lifted and you can write, e.g., the following program:

0 commit comments

Comments
 (0)