Skip to content
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

Add some useful scalac options and fix stuff #310

Merged
merged 3 commits into from
Sep 9, 2024
Merged

Conversation

lenguyenthanh
Copy link
Member

No description provided.

```
[warn] -- [E165] Type Warning: /Users/tle/git/lichess/lila-search/modules/elastic/src/main/scala/game.scala:107:18
[warn] 107 |          case s: String => termQuery(name, s.toLowerCase)
[warn]     |                  ^^^^^^
[warn]     |                  pattern selector should be an instance of Matchable,
[warn]     |                  but it has unmatchable type query.A instead
[warn]     |---------------------------------------------------------------------------
[warn]     | Explanation (enabled by `-explain`)
[warn]     |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[warn]     | A value of type query.A cannot be the selector of a match expression
[warn]     | since it is not constrained to be `Matchable`. Matching on unconstrained
[warn]     | values is disallowed since it can uncover implementation details that
[warn]     | were intended to be hidden and thereby can violate paramtetricity laws
[warn]     | for reasoning about programs.
[warn]     |
[warn]     | The restriction can be overridden by appending `.asMatchable` to
[warn]     | the selector value. `asMatchable` needs to be imported from
[warn]     | scala.compiletime. Example:
[warn]     |
[warn]     |     import compiletime.asMatchable
[warn]     |     def f[X](x: X) = x.asMatchable match { ... }
[warn]      ---------------------------------------------------------------------------
[warn] one warning found
```
@lenguyenthanh lenguyenthanh merged commit ee635cd into master Sep 9, 2024
3 checks passed
@lenguyenthanh lenguyenthanh deleted the scalac branch September 9, 2024 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant