docs.scala-lang
docs.scala-lang copied to clipboard
Update FAQ entry about `scala.util.Properties.versionNumberString` to cover JS and Native
https://docs.scala-lang.org/tutorials/FAQ/index.html#i-want-scala-3-why-does-versionnumberstring-say-im-on-213
TIL on Scala.js that it doesn't work because it tries to read a resource and Scala.js doesn't do that
so I guess the entry will have to suggest sbt-buildinfo and/or the Scala-CLI equivalent (they recently added one)
what about Native, does it work on Native?
With the following script:
//> using scala 3.3.1
println("version:" + scala.util.Properties.versionNumberString)
I can get it to work on both JVM and Native.
However, I get version:2.13.10 on the JVM and version:2.13.11 on native. So I wonder if something funky is going on here.
Using scala-cli v..0.4 and Scala Native v0.4.14
However, I get version:2.13.10 on the JVM
That's expected; by 3.3.2 we should have 2.13.12; I'm pursuing it at https://github.com/lampepfl/dotty/pull/18525#issuecomment-1711986420
version:2.13.11 on native.
That, I don't understand
when I'm updating this, I should consider whether it makes sense to further expand the FAQ answer, or whether this info could move to the Scaladoc. we try to avoid having the FAQ be the main documentation point for anything, preferring FAQ answers to be kept short and primarily link to information living elsewhere