-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.scala
41 lines (32 loc) · 2 KB
/
project.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//> using scala 3.6.2
//> using native-version 0.5.6
//> using js-version 1.17.0
// set a specific source level for warnings/rewrites/features
// generally recommended to get consistent behaviour
//> using option -source 3.6
// 1) changes the available JDK APIs,
// 2) sets the classfile version (and maybe enables some associated classfile features)
// should generally be set to something, otherwise all features from the randomly selected current JDK are available
//> using option -java-output-version 23
// Spell out feature and deprecation warnings instead of summarizing them into a single warning
// always turn this on to make the compiler less ominous
//> using option -feature -deprecation
// treat warnings as errors
// generally, adressing warnings as they come up is much less work than fixing problems later
// do consider disabling for migrations and large refactorings to allow those changes to happen in smaller steps
//> using option -Werror
// seems generally unobtrusive (just add some explicit ()) and otherwise helpful
//> using option -Wvalue-discard
// can be annoying with methods that have optional results, can also help with methods that have non optional results …
//!> using option -Wnonunit-statement
// type parameter shadowing often is accidental, and especially for short type names keeping them separate seems good
//> using option -Wshadow:type-parameter-shadow
// this is -Ysafe-init for scala 3.4 and below, but we don’t use that because seems to produce compiler crashes in those versions
// found a crash in 3.5+ … but seems rare enough … ?
//> using option -Wsafe-init
// makes Null no longer be a sub type of all subtypes of AnyRef
// but is super annoying with java interop.
// Scala 3.5 tries to improve that interop by making java return types special, see https://github.com/scala/scala3/pull/17369
// If i understand correctly, that is enabled by default, and the second flag could be used to restore old behaviour
//> using option -Yexplicit-nulls
//!> using option -Yno-flexible-types