Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Move undefOr2jsAny implicit conversion to js.Any companion #4904

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
Sep 20, 2023

Conversation

armanbilge
Copy link
Member

@armanbilge armanbilge commented Sep 19, 2023

As discussed on Discord. Sorry, I did the minimal thing, and will appreciate hints for what else to do πŸ˜…

The motivation for this change is that this implicit conversion will automatically be in scope on Scala 3 (as well as Scala 2), which is not currently the case. This forces the use of casts in user code as can be seen in the scala-js-dom Scala 3 PR in scala-js/scala-js-dom#450.

Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

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

There's probably not much actual unit testing we can do. However, it would be good to test locally. Have you tried to publish locally using the instructions at https://github.com/scala-js/scala-js/blob/main/DEVELOPING.md#publish-locally (for 2.13.11) then validate that it works the way we want in a Scala 3 project?

@armanbilge
Copy link
Member Author

There's probably not much actual unit testing we can do.

How would you feel about adding a test here?

object Main {
def main(args: Array[String]): Unit = {
println("Hello Scala.js")
// Testing the Scala 3 runtime library
println(Color.Red)
assert(Color.Red.toString() == "Red")
// Testing the library resolved with %%% + withDottyCompat
assert(Types.IntType.show() == "int")
}
}

@sjrd
Copy link
Member

sjrd commented Sep 19, 2023

Oh yes we can add a test in there. Good point.

@armanbilge armanbilge changed the title Move undefOr2jsAny implicit conversion to Any companion Move undefOr2jsAny implicit conversion to js.Any companion Sep 19, 2023
@armanbilge
Copy link
Member Author

Did the appveyor have a legitimate failure, or did it just timeout?

@sjrd
Copy link
Member

sjrd commented Sep 20, 2023

Did the appveyor have a legitimate failure, or did it just timeout?

Spurious failure, apparently. Rerunning the build made it pass.

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.

2 participants