@@ -2,29 +2,36 @@ package dotty.tools.dotc.config
2
2
3
3
object Config {
4
4
5
- final val cacheMembersNamed = true
6
- final val cacheAsSeenFrom = true
7
- final val cacheMemberNames = true
8
- final val cacheImplicitScopes = true
9
- final val cacheMatchReduced = true
5
+ inline val cacheMembersNamed = true
6
+ inline val cacheAsSeenFrom = true
7
+ inline val cacheMemberNames = true
8
+ inline val cacheImplicitScopes = true
9
+ inline val cacheMatchReduced = true
10
10
11
- final val checkCacheMembersNamed = false
11
+ /** If true, the `runWithOwner` operation uses a re-usable context,
12
+ * similar to explore. This requires that the context does not escape
13
+ * the call. If false, `runWithOwner` runs its operation argument
14
+ * in a fresh context.
15
+ */
16
+ inline val reuseOwnerContexts = true
17
+
18
+ inline val checkCacheMembersNamed = false
12
19
13
20
/** When updating a constraint bound, check that the constrained parameter
14
21
* does not appear at the top-level of either of its bounds.
15
22
*/
16
- final val checkConstraintsNonCyclic = false
23
+ inline val checkConstraintsNonCyclic = false
17
24
18
25
/** Check that each constraint resulting from a subtype test
19
26
* is satisfiable.
20
27
*/
21
- final val checkConstraintsSatisfiable = false
28
+ inline val checkConstraintsSatisfiable = false
22
29
23
30
/** Check that each constraint is fully propagated. i.e.
24
31
* If P <: Q then the upper bound of P is a subtype of the upper bound of Q
25
32
* and the lower bound of Q is a subtype of the lower bound of P.
26
33
*/
27
- final val checkConstraintsPropagated = false
34
+ inline val checkConstraintsPropagated = false
28
35
29
36
/** Check that constraints of globally committable typer states are closed.
30
37
* NOTE: When enabled, the check can cause CyclicReference errors because
@@ -35,51 +42,51 @@ object Config {
35
42
* It is recommended to turn this option on only when chasing down
36
43
* a TypeParamRef instantiation error. See comment in Types.TypeVar.instantiate.
37
44
*/
38
- final val debugCheckConstraintsClosed = false
45
+ inline val debugCheckConstraintsClosed = false
39
46
40
47
/** Check that no type appearing as the info of a SymDenotation contains
41
48
* skolem types.
42
49
*/
43
- final val checkNoSkolemsInInfo = false
50
+ inline val checkNoSkolemsInInfo = false
44
51
45
52
/** Check that Name#toString is not called directly from backend by analyzing
46
53
* the stack trace of each toString call on names. This is very expensive,
47
54
* so not suitable for continuous testing. But it can be used to find a problem
48
55
* when running a specific test.
49
56
*/
50
- final val checkBackendNames = false
57
+ inline val checkBackendNames = false
51
58
52
59
/** Check that re-used type comparers are in their initialization state */
53
- final val checkTypeComparerReset = false
60
+ inline val checkTypeComparerReset = false
54
61
55
62
/** Type comparer will fail with an assert if the upper bound
56
63
* of a constrained parameter becomes Nothing. This should be turned
57
64
* on only for specific debugging as normally instantiation to Nothing
58
65
* is not an error condition.
59
66
*/
60
- final val failOnInstantiationToNothing = false
67
+ inline val failOnInstantiationToNothing = false
61
68
62
69
/** Enable noDoubleDef checking if option "-YnoDoubleDefs" is set.
63
70
* The reason to have an option as well as the present global switch is
64
71
* that the noDoubleDef checking is done in a hotspot, and we do not
65
72
* want to incur the overhead of checking an option each time.
66
73
*/
67
- final val checkNoDoubleBindings = true
74
+ inline val checkNoDoubleBindings = true
68
75
69
76
/** Check positions for consistency after parsing */
70
- final val checkPositions = true
77
+ inline val checkPositions = true
71
78
72
79
/** Check that typed trees don't point to untyped ones */
73
- final val checkTreesConsistent = false
80
+ inline val checkTreesConsistent = false
74
81
75
82
/** Show subtype traces for all deep subtype recursions */
76
- final val traceDeepSubTypeRecursions = false
83
+ inline val traceDeepSubTypeRecursions = false
77
84
78
85
/** When explaining subtypes and this flag is set, also show the classes of the compared types. */
79
- final val verboseExplainSubtype = false
86
+ inline val verboseExplainSubtype = false
80
87
81
88
/** If this flag is set, take the fast path when comparing same-named type-aliases and types */
82
- final val fastPathForRefinedSubtype = true
89
+ inline val fastPathForRefinedSubtype = true
83
90
84
91
/** If this flag is set, and we compute `T1[X1]` & `T2[X2]` as a new
85
92
* upper bound of a constrained parameter, try to align the arguments by computing
@@ -88,20 +95,20 @@ object Config {
88
95
*
89
96
* For more info, see the comment in `TypeComparer#glbArgs`.
90
97
*/
91
- final val alignArgsInAnd = true
98
+ inline val alignArgsInAnd = true
92
99
93
100
/** If this flag is set, higher-kinded applications are checked for validity
94
101
*/
95
- final val checkHKApplications = false
102
+ inline val checkHKApplications = false
96
103
97
104
/** If this flag is set, method types are checked for valid parameter references
98
105
*/
99
- final val checkMethodTypes = false
106
+ inline val checkMethodTypes = false
100
107
101
108
/** If this flag is set, it is checked that TypeRefs don't refer directly
102
109
* to themselves.
103
110
*/
104
- final val checkTypeRefCycles = false
111
+ inline val checkTypeRefCycles = false
105
112
106
113
/** If this flag is set, we check that types assigned to trees are error types only
107
114
* if some error was already reported. There are complicicated scenarios where this
@@ -113,35 +120,35 @@ object Config {
113
120
* this in all circumstances. But since it is almost always true it is useful to
114
121
* keep the Config option for debugging.
115
122
*/
116
- final val checkUnreportedErrors = false
123
+ inline val checkUnreportedErrors = false
117
124
118
125
/** If this flag is set, it is checked that class type parameters are
119
126
* only references with NoPrefix or ThisTypes as prefixes. This option
120
127
* is usually disabled, because there are still some legitimate cases where
121
128
* this can arise (e.g. for pos/Map.scala, in LambdaType.integrate).
122
129
*/
123
- final val checkTypeParamRefs = false
130
+ inline val checkTypeParamRefs = false
124
131
125
132
/** The recursion depth for showing a summarized string */
126
- final val summarizeDepth = 2
133
+ inline val summarizeDepth = 2
127
134
128
135
/** Check that variances of lambda arguments match the
129
136
* variance of the underlying lambda class.
130
137
*/
131
- final val checkLambdaVariance = false
138
+ inline val checkLambdaVariance = false
132
139
133
140
/** Check that certain types cannot be created in erasedTypes phases.
134
141
* Note: Turning this option on will get some false negatives, since it is
135
142
* possible that And/Or types are still created during erasure as the result
136
143
* of some operation on an existing type.
137
144
*/
138
- final val checkUnerased = false
145
+ inline val checkUnerased = false
139
146
140
147
/** Check that atoms-based comparisons match regular comparisons that do not
141
148
* take atoms into account. The two have to give the same results, since
142
149
* atoms comparison is intended to be just an optimization.
143
150
*/
144
- final val checkAtomsComparisons = false
151
+ inline val checkAtomsComparisons = false
145
152
146
153
/** In `derivedSelect`, rewrite
147
154
*
@@ -151,39 +158,39 @@ object Config {
151
158
* Not sure whether this is useful. Preliminary measurements show a slowdown of about
152
159
* 7% for the build when this option is enabled.
153
160
*/
154
- final val splitProjections = false
161
+ inline val splitProjections = false
155
162
156
163
/** If this flag is on, always rewrite an application `S[Ts]` where `S` is an alias for
157
164
* `[Xs] -> U` to `[Xs := Ts]U`.
158
165
* Turning this flag on was observed to give a ~6% speedup on the JUnit test suite.
159
166
*/
160
- final val simplifyApplications = true
167
+ inline val simplifyApplications = true
161
168
162
169
/** Assume -indent by default */
163
- final val defaultIndent = true
170
+ inline val defaultIndent = true
164
171
165
172
/** If set, prints a trace of all symbol completions */
166
- final val showCompletions = false
173
+ inline val showCompletions = false
167
174
168
175
/** If set, method results that are context functions are flattened by adding
169
176
* the parameters of the context function results to the methods themselves.
170
177
* This is an optimization that reduces closure allocations.
171
178
*/
172
- final val flattenContextFunctionResults = true
179
+ inline val flattenContextFunctionResults = true
173
180
174
181
/** If set, enables tracing */
175
- final val tracingEnabled = false
182
+ inline val tracingEnabled = false
176
183
177
184
/** Initial capacity of uniques HashMap.
178
185
* Note: This MUST BE a power of two to work with util.HashSet
179
186
*/
180
- final val initialUniquesCapacity = 65536
187
+ inline val initialUniquesCapacity = 65536
181
188
182
189
/** How many recursive calls to NamedType#underlying are performed before logging starts. */
183
- final val LogPendingUnderlyingThreshold = 50
190
+ inline val LogPendingUnderlyingThreshold = 50
184
191
185
192
/** How many recursive calls to isSubType are performed before logging starts. */
186
- final val LogPendingSubTypesThreshold = 50
193
+ inline val LogPendingSubTypesThreshold = 50
187
194
188
195
/** How many recursive calls to findMember are performed before logging names starts
189
196
* Note: this threshold has to be chosen carefully. Too large, and programs
@@ -194,8 +201,8 @@ object Config {
194
201
* dotty itself only causes small pending names lists to be generated (we measured
195
202
* at max 6 elements) and these lists are never searched with contains.
196
203
*/
197
- final val LogPendingFindMemberThreshold = 9
204
+ inline val LogPendingFindMemberThreshold = 9
198
205
199
206
/** When in IDE, turn StaleSymbol errors into warnings instead of crashing */
200
- final val ignoreStaleInIDE = true
207
+ inline val ignoreStaleInIDE = true
201
208
}
0 commit comments