diff options
author | Rubén Rincón Blanco <ruben@rinconblanco.es> | 2022-04-26 15:24:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-26 15:24:40 +0200 |
commit | 4965bd6c8101001dd124df38b3da43cdc2c360a4 (patch) | |
tree | 4d7e8133219f88e3e6361cceea9bebb84b62ab02 /lib/compilers/scala.js | |
parent | e3b9039095333ae3cdec1b9f47419ebac33b6fec (diff) | |
download | compiler-explorer-4965bd6c8101001dd124df38b3da43cdc2c360a4.tar.gz compiler-explorer-4965bd6c8101001dd124df38b3da43cdc2c360a4.zip |
All semver comparisons now ensure it's safe to do so (#3562)
* All semver comparisons now ensure it's safe to do so
* Oops, use correct class
* Remove leftover import
* Leave the Zig fixes for another PR
* Fix linter
* Fix test issues
* Make linter happy, yet again
* What?
* Address PR review
Diffstat (limited to 'lib/compilers/scala.js')
-rw-r--r-- | lib/compilers/scala.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/compilers/scala.js b/lib/compilers/scala.js index d6c380649..d20c6b9c8 100644 --- a/lib/compilers/scala.js +++ b/lib/compilers/scala.js @@ -22,6 +22,10 @@ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. +import Semver from 'semver'; + +import {asSafeVer} from '../utils'; + import { ScalaParser } from './argument-parsers'; import { JavaCompiler } from './java'; @@ -71,7 +75,7 @@ export class ScalaCompiler extends JavaCompiler { '-deprecation', ]; - return this.compiler.semver.startsWith('3') ? scala3Opts : scala2Opts; + return Semver.gte(asSafeVer(this.compiler.semver), '3.0.0', true) ? scala3Opts : scala2Opts; } getArgumentParser() { |