Skip to content

Delete dead, name-forcing code - fixing nightlies #13901

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

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 0 additions & 7 deletions compiler/src/dotty/tools/dotc/core/Definitions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1387,13 +1387,6 @@ class Definitions {
else NoType
}

val predefClassNames: Set[Name] =
Set("Predef$", "DeprecatedPredef", "LowPriorityImplicits").map(_.toTypeName.unmangleClassName)

/** Is `cls` the predef module class, or a class inherited by Predef? */
def isPredefClass(cls: Symbol): Boolean =
(cls.owner eq ScalaPackageClass) && predefClassNames.contains(cls.name)

private val JavaImportFns: List[RootRef] = List(
RootRef(() => JavaLangPackageVal.termRef)
)
Expand Down
8 changes: 4 additions & 4 deletions tests/neg-custom-args/deprecation/t3235-minimal.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
object Test {
def main(args: Array[String]): Unit = {
assert(123456789.round == 123456789) // error
assert(math.round(123456789) == 123456789) // error
assert(1234567890123456789L.round == 1234567890123456789L) // error
assert(math.round(1234567890123456789L) == 1234567890123456789L) // error
assert(123456789.round == 123456789) // error (Int to Flaot)
assert(math.round(123456789) == 123456789)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That behavior seems correct. round is overloaded, so there is no expected type yet. This seems to indicate that the tests are done in the wrong phase. Maybe we should test this only after Typer?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe test assert(math.round(123456789) == 123456789) in another test file to test the other error/warning.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the test was correct. I just wanted a pull request ready that we could merge today to unbreak the nightly builds. I spent some time with Lukas and I think we should be able to merge #13911 instead. If something comes up I'll PR moving the test instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ironically, @nicolasstucki, it's thanks to the fact that these were in the same file that we even found that the wrong warning was being emitted. I'm still not sure I like this new "// error" with no message assertion practice that scala 3 has introduced..

assert(1234567890123456789L.round == 1234567890123456789L) // error (Long to Float)
assert(math.round(1234567890123456789L) == 1234567890123456789L)
}
}