Skip to content

Fixes typo in documentation to erased terms #8605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/docs/reference/metaprogramming/erased-terms.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sealed trait State
final class On extends State
final class Off extends State

@implicitNotFound("State is must be Off")
@implicitNotFound("State must be Off")
class IsOff[S <: State]
object IsOff {
implicit def isOff: IsOff[Off] = new IsOff[Off]
Expand All @@ -32,7 +32,7 @@ val m = new Machine[Off]
m.turnedOn
m.turnedOn.turnedOn // ERROR
// ^
// State is must be Off
// State must be Off
```

Note that in the code above the actual context arguments for `IsOff` are never
Expand Down Expand Up @@ -118,14 +118,14 @@ sealed trait State
final class On extends State
final class Off extends State

@implicitNotFound("State is must be Off")
@implicitNotFound("State must be Off")
class IsOff[S <: State]
object IsOff {
// will not be called at runtime for turnedOn, the compiler will only require that this evidence exists
given IsOff[Off] = new IsOff[Off]
}

@implicitNotFound("State is must be On")
@implicitNotFound("State must be On")
class IsOn[S <: State]
object IsOn {
// will not exist at runtime, the compiler will only require that this evidence exists at compile time
Expand All @@ -150,11 +150,11 @@ object Test {

// m.turnedOff
// ^
// State is must be On
// State must be On

// m.turnedOn.turnedOn
// ^
// State is must be Off
// State must be Off
}
}
```
Expand Down Expand Up @@ -196,4 +196,4 @@ object Test {
}
```

[More Details](./erased-terms-spec.md)
[More Details](./erased-terms-spec.md)
8 changes: 4 additions & 4 deletions tests/run-custom-args/erased/erased-machine-state.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sealed trait State
final class On extends State
final class Off extends State

@implicitNotFound("State is must be Off")
@implicitNotFound("State must be Off")
class IsOff[S <: State]
object IsOff {
implicit def isOff: IsOff[Off] = {
Expand All @@ -13,7 +13,7 @@ object IsOff {
}
}

@implicitNotFound("State is must be On")
@implicitNotFound("State must be On")
class IsOn[S <: State]
object IsOn {
implicit def isOn: IsOn[On] = {
Expand Down Expand Up @@ -48,10 +48,10 @@ object Test {

// m.turnedOff
// ^
// State is must be On
// State must be On

// m.turnedOn.turnedOn
// ^
// State is must be Off
// State must be Off
}
}