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

Deprecate XML literals #19100

Open
SethTisue opened this issue Nov 28, 2023 · 3 comments
Open

Deprecate XML literals #19100

SethTisue opened this issue Nov 28, 2023 · 3 comments

Comments

@SethTisue
Copy link
Member

SethTisue commented Nov 28, 2023

@nicolasstucki seems like probably an oversight that there isn't already a ticket on this? (that I can find)

not sure what the right timetable is. at present, it doesn't even warn under -source:future

% scala-cli -S 3.nightly -source:future --dep org.scala-lang.modules::scala-xml:2.2.0
Welcome to Scala 3.4.0-RC1-bin-20231127-41e7d95-NIGHTLY-git-41e7d95 (17.0.9, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                    
scala> <foo/>
val res0: scala.xml.Elem = <foo/>

at minimum, I think it should warn under -source:future, as the SIP committee has already authorized the eventual removal of XML literals from the language, and the Scala 3 reference doc already lists it under "Dropped Features" (https://docs.scala-lang.org/scala3/reference/dropped-features/xml.html)

whether it's time to actually deprecate, I don't have a strong opinion about. I don't know how polished or usable https://github.com/lampepfl/xml-interpolator is. the availability of a suitable substitute has always been the major concern here, iirc

@SethTisue SethTisue added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Nov 28, 2023
@SethTisue
Copy link
Member Author

SethTisue commented Nov 28, 2023

Also, I think the XML chapter of the Scala 3 spec could be deleted. I don't think we need to wait for the feature to actually be deleted from the compiler. It's already legacy, and it will remain available in the Scala 2 spec for reference. cc @sjrd

@nicolasstucki nicolasstucki self-assigned this Dec 4, 2023
@nicolasstucki nicolasstucki removed the stat:needs triage Every issue needs to have an "area" and "itype" label label Dec 4, 2023
@nicolasstucki nicolasstucki removed their assignment Jan 10, 2024
@SethTisue
Copy link
Member Author

with #19101 merged, the default behavior remains not-even-a-warning, but the -source:future behavior is a hard error:

1 |<foo/>
  | ^^^^^
  |XML literals are no longer supported.
  |See https://docs.scala-lang.org/scala3/reference/dropped-features/xml.html

@nicolasstucki
Copy link
Contributor

This behavior was intentional. We decided to deprecate it later. See https://github.com/orgs/lampepfl/projects/2/views/11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants