8000 Warn on bad extensions of aliases by RoccoMathijn · Pull Request #22362 · scala/scala3 · GitHub
[go: up one dir, main page]

Skip to content

Warn on bad extensions of aliases #22362

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 4 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
pr remarks
  • Loading branch information
RoccoMathijn committed Jan 28, 2025
commit 2685ba99f98c9bd4f991a339131c5ce826f9611b
3 changes: 1 addition & 2 deletions compiler/src/dotty/tools/dotc/typer/RefChecks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1190,8 +1190,7 @@ object RefChecks {
}
}
.exists
if !target.typeSymbol.denot.isOpaqueAlias // Opaque types hide original members so extension is not nullified by the original member
&& hidden
if !target.typeSymbol.isOpaqueAlias && hidden
then report.warning(ExtensionNullifiedByMember(sym, target.typeSymbol), sym.srcPos)
end checkExtensionMethods

Expand Down
7 changes: 0 additions & 7 deletions tests/warn/i22233.check

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package warns

//> using options -Xfatal-warnings

trait Foo[T]:
Expand Down
Loading
0