Repository navigation
Expand file tree
/
Copy pathfeatures-classification.html
More file actions
183 lines (183 loc) · 78.7 KB
/
Copy pathfeatures-classification.html
File metadata and controls
183 lines (183 loc) · 78.7 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!DOCTYPE html><html data-githubContributorsUrl="https://api.github.com/repos/scala/scala3" data-githubContributorsFilename="docs/_docs/reference/features-classification.md" data-pathToRoot="" data-rawLocation="features-classification" data-dynamicSideMenu="false"><head><meta charset="utf-8"></meta><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"></meta><title>A Classification of Proposed Language Features</title><link rel="shortcut icon" type="image/x-icon" href="favicon.ico"></link><script type="text/javascript" src="scripts/theme.js"></script><script type="text/javascript" src="scripts/searchData.js" defer="true"></script><script type="text/javascript" src="scripts/scastieConfiguration.js" defer="true"></script><link rel="stylesheet" href="styles/theme/bundle.css"></link><link rel="stylesheet" href="styles/theme/components/bundle.css"></link><link rel="stylesheet" href="styles/theme/components/button/bundle.css"></link><link rel="stylesheet" href="styles/theme/layout/bundle.css"></link><link rel="stylesheet" href="styles/dotty-icons.css"></link><link rel="stylesheet" href="styles/filter-bar.css"></link><link rel="stylesheet" href="styles/searchbar.css"></link><link rel="stylesheet" href="styles/social-links.css"></link><link rel="stylesheet" href="styles/versions-dropdown.css"></link><link rel="stylesheet" href="styles/content-contributors.css"></link><script type="text/javascript" src="hljs/highlight.pack.js" defer="true"></script><script type="text/javascript" src="scripts/hljs-scala3.js" defer="true"></script><script type="text/javascript" src="scripts/ux.js" defer="true"></script><script type="text/javascript" src="scripts/common/component.js" defer="true"></script><script type="text/javascript" src="scripts/common/utils.js" defer="true"></script><script type="text/javascript" src="scripts/components/FilterBar.js" defer="true"></script><script type="text/javascript" src="scripts/components/DocumentableList.js" defer="true"></script><script type="text/javascript" src="scripts/components/Input.js" defer="true"></script><script type="text/javascript" src="scripts/components/FilterGroup.js" defer="true"></script><script type="text/javascript" src="scripts/components/Filter.js" defer="true"></script><script type="text/javascript" src="scripts/scaladoc-scalajs.js" defer="true"></script><script type="text/javascript" src="scripts/contributors.js" defer="true"></script><script type="text/javascript" src="https://d3js.org/d3.v6.min.js" defer="true"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/graphlib-dot@0.6.2/dist/graphlib-dot.min.js" defer="true"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/dagre-d3/0.6.1/dagre-d3.min.js" defer="true"></script><script type="text/javascript" src="https://scastie.scala-lang.org/embedded.js" defer="true"></script><script type="text/javascript" src="scripts/data.js" defer="true"></script><script>var pathToRoot = "";</script><link rel="dns-prefetch" href="//fonts.googleapis.com">
<link rel="preconnect" href="https://cdnjs.cloudflare.com" crossorigin data-proofer-ignore>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="/css/dottydoc.css"></head><body><div id=""><div id="header" class="body-small"><div class="header-container-left"><a href="" class="logo-container"><span id="project-logo" class="project-logo"><img src="project-logo/logo.svg"></img></span><span id="dark-project-logo" class="project-logo"><img src="project-logo/logo_dark.svg"></img></span><span class="project-name h300">Scala 3 Reference</span></a><span onclick="dropdownHandler(event)" class="text-button with-arrow" id="dropdown-trigger"><a><div class="projectVersion">3.10.0</div></a></span><div id="version-dropdown" class="dropdown-menu"></div></div><div class="header-container-right"><button id="search-toggle" class="icon-button"></button><a href="https://docs.scala-lang.org/" class="text-button">Learn</a><a href="https://www.scala-lang.org/download/" class="text-button">Install</a><a href="https://scastie.scala-lang.org" class="text-button">Playground</a><a href="https://index.scala-lang.org" class="text-button">Find A Library</a><a href="https://www.scala-lang.org/community/" class="text-button">Community</a><a href="https://www.scala-lang.org/blog/" class="text-button">Blog</a><span id="theme-toggle" class="icon-button"></span><span id="mobile-menu-toggle" class="icon-button hamburger"></span></div></div><div id="mobile-menu"><div class="mobile-menu-header body-small"><span class="mobile-menu-logo"><span id="project-logo" class="project-logo"><img src="project-logo/logo.svg"></img></span><span id="dark-project-logo" class="project-logo"><img src="project-logo/logo_dark.svg"></img></span><span class="project-name h300">Scala 3 Reference</span></span><button id="mobile-menu-close" class="icon-button close"></button></div><div class="mobile-menu-container body-medium"><input id="mobile-scaladoc-searchbar-input" class="scaladoc-searchbar-input" type="search" placeholder="Find anything"></input><a href="https://docs.scala-lang.org/" class="mobile-menu-item">Learn</a><a href="https://www.scala-lang.org/download/" class="mobile-menu-item">Install</a><a href="https://scastie.scala-lang.org" class="mobile-menu-item">Playground</a><a href="https://index.scala-lang.org" class="mobile-menu-item">Find A Library</a><a href="https://www.scala-lang.org/community/" class="mobile-menu-item">Community</a><a href="https://www.scala-lang.org/blog/" class="mobile-menu-item">Blog</a><span id="mobile-theme-toggle" class="mobile-menu-item mode"></span></div></div><span id="mobile-sidebar-toggle" class="floating-button"></span><div id="leftColumn" class="body-small"><div class="switcher-container"><a id="docs-nav-button" class="switcher h100 selected" href="index.html">Docs</a></div><nav id="docs-nav" class="side-menu"><div class="ni n0"><span class="nh de"><button class="ar icon-button "></button><a href="new-types/index.html"><span>New Types</span></a></span><div class="ni n1 "><span class="nh de"><a href="new-types/intersection-types.html"><span>Intersection Types</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="new-types/union-types.html"><span>Union Types</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="new-types/type-lambdas.html"><span>Type Lambdas</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="new-types/match-types.html"><span>Match Types</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="new-types/dependent-function-types.html"><span>Dependent Function Types</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="new-types/polymorphic-function-types.html"><span>Polymorphic Function Types</span></a></span></div></div><div class="ni n0"><span class="nh de"><button class="ar icon-button "></button><a href="enums/index.html"><span>Enums</span></a></span><div class="ni n1 "><span class="nh de"><a href="enums/enums.html"><span>Enumerations</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="enums/adts.html"><span>Algebraic Data Types</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="enums/desugarEnums.html"><span>Translation of Enums and ADTs</span></a></span></div></div><div class="ni n0"><span class="nh de"><button class="ar icon-button "></button><a href="contextual/index.html"><span>Contextual Abstractions</span></a></span><div class="ni n1 "><span class="nh de"><a href="contextual/givens.html"><span>Given Instances</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="contextual/using-clauses.html"><span>Using Clauses</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="contextual/context-bounds.html"><span>Context Bounds</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="contextual/deferred-givens.html"><span>Deferred Givens</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="contextual/given-imports.html"><span>Importing Givens</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="contextual/more-givens.html"><span>Other Forms Of Givens</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="contextual/extension-methods.html"><span>Extension Methods</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="contextual/right-associative-extension-methods.html"><span>Right-Associative Extension Methods: Details</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="contextual/type-classes.html"><span>Implementing Type classes</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="contextual/derivation.html"><span>Type Class Derivation</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="contextual/derivation-macro.html"><span>How to write a type class `derived` method using macros</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="contextual/multiversal-equality.html"><span>Multiversal Equality</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="contextual/context-functions.html"><span>Context Functions</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="contextual/conversions.html"><span>Implicit Conversions</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="contextual/by-name-context-parameters.html"><span>By-Name Context Parameters</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="contextual/relationship-implicits.html"><span>Relationship with Scala 2 Implicits</span></a></span></div></div><div class="ni n0"><span class="nh de"><button class="ar icon-button "></button><a href="metaprogramming/index.html"><span>Metaprogramming</span></a></span><div class="ni n1 "><span class="nh de"><a href="metaprogramming/inline.html"><span>Inline</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="metaprogramming/compiletime-ops.html"><span>Compile-time operations</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="metaprogramming/macros.html"><span>Macros</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="metaprogramming/simple-smp.html"><span>The Meta-theory of Symmetric Metaprogramming</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="metaprogramming/staging.html"><span>Run-Time Multi-Stage Programming</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="metaprogramming/reflection.html"><span>Reflection</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="metaprogramming/tasty-inspect.html"><span>TASTy Inspection</span></a></span></div></div><div class="ni n0"><span class="nh de"><button class="ar icon-button "></button><a href="other-new-features/index.html"><span>Other New Features</span></a></span><div class="ni n1 "><span class="nh de"><a href="other-new-features/trait-parameters.html"><span>Trait Parameters</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/transparent-traits.html"><span>Transparent Traits and Classes</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/creator-applications.html"><span>Universal Apply Methods</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/export.html"><span>Export Clauses</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/opaques.html"><span>Opaque Type Aliases</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/opaques-details.html"><span>Opaque Type Aliases: More Details</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/named-tuples.html"><span>Named Tuples</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/open-classes.html"><span>Open Classes</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/parameter-untupling.html"><span>Parameter Untupling</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/generalized-method-syntax.html"><span>Generalized Method Syntax</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/kind-polymorphism.html"><span>Kind Polymorphism</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/matchable.html"><span>The Matchable Trait</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/threadUnsafe-annotation.html"><span>The @threadUnsafe annotation</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/targetName.html"><span>The @targetName annotation</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/control-syntax.html"><span>New Control Syntax</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/indentation.html"><span>Optional Braces</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/safe-initialization.html"><span>Safe Initialization</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/type-test.html"><span>TypeTest</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/experimental-defs.html"><span>Experimental Definitions</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/preview-defs.html"><span>Preview Definitions</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/binary-literals.html"><span>Binary Integer Literals</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/toplevel-definitions.html"><span>Toplevel Definitions</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/better-fors.html"><span>Better fors</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/runtimeChecked.html"><span>The runtimeChecked method</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="other-new-features/into.html"><span>The `into` Type and Modifier</span></a></span></div></div><div class="ni n0"><span class="nh de"><button class="ar icon-button "></button><a href="changed-features/index.html"><span>Other Changed Features</span></a></span><div class="ni n1 "><span class="nh de"><a href="changed-features/numeric-literals.html"><span>Numeric Literals</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/structural-types.html"><span>Programmatic Structural Types</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/operators.html"><span>Rules for Operators</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/wildcards.html"><span>Wildcard Arguments in Types</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/imports.html"><span>Imports</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/type-inference.html"><span>Changes in Type Inference</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/implicit-resolution.html"><span>Changes in Implicit Resolution</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/implicit-conversions.html"><span>Implicit Conversions</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/overload-resolution.html"><span>Changes in Overload Resolution</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/match-syntax.html"><span>Match Expressions</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/vararg-splices.html"><span>Vararg Splices</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/pattern-bindings.html"><span>Pattern Bindings</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/pattern-matching.html"><span>Option-less pattern matching</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/eta-expansion.html"><span>Automatic Eta Expansion</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/compiler-plugins.html"><span>Changes in Compiler Plugins</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/lazy-vals-init.html"><span>Lazy Vals Initialization</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/main-functions.html"><span>Main Methods</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="changed-features/interpolation-escapes.html"><span>Escapes in interpolations</span></a></span></div></div><div class="ni n0"><span class="nh de"><button class="ar icon-button "></button><a href="dropped-features/index.html"><span>Dropped Features</span></a></span><div class="ni n1 "><span class="nh de"><a href="dropped-features/delayed-init.html"><span>Dropped: DelayedInit</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="dropped-features/macros.html"><span>Dropped: Scala 2 Macros</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="dropped-features/existential-types.html"><span>Dropped: Existential Types</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="dropped-features/type-projection.html"><span>Dropped: General Type Projection</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="dropped-features/do-while.html"><span>Dropped: Do-While</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="dropped-features/procedure-syntax.html"><span>Dropped: Procedure Syntax</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="dropped-features/package-objects.html"><span>Dropped: Package Objects</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="dropped-features/early-initializers.html"><span>Dropped: Early Initializers</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="dropped-features/class-shadowing.html"><span>Dropped: Class Shadowing</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="dropped-features/limit22.html"><span>Dropped: Limit 22</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="dropped-features/xml.html"><span>Dropped: XML Literals</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="dropped-features/symlits.html"><span>Dropped: Symbol Literals</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="dropped-features/auto-apply.html"><span>Dropped: Auto-Application</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="dropped-features/weak-conformance.html"><span>Dropped: Weak Conformance</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="dropped-features/nonlocal-returns.html"><span>Deprecated: Nonlocal Returns</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="dropped-features/this-qualifier.html"><span>Dropped: private[this] and protected[this]</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="dropped-features/wildcard-init.html"><span>Dropped: Wildcard Initializer</span></a></span></div></div><div class="ni n0"><span class="nh de"><button class="ar icon-button "></button><a href="preview/index.html"><span>Preview</span></a></span><div class="ni n1 "><span class="nh de"><a href="preview/unrolled-defs.html"><span>Automatic Parameter Unrolling</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="preview/relaxed-lambdas.html"><span>Relaxed Lambda Syntax</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="preview/package-object-values.html"><span>Reference-able Package Objects</span></a></span></div></div><div class="ni n0"><span class="nh de"><button class="ar icon-button "></button><a href="experimental/index.html"><span>Experimental</span></a></span><div class="ni n1 "><span class="nh de"><a href="experimental/canthrow.html"><span>CanThrow Capabilities</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="experimental/erased-defs.html"><span>Erased Definitions</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="experimental/named-typeargs.html"><span>Named Type Arguments</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="experimental/numeric-literals.html"><span>Numeric Literals</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="experimental/explicit-nulls.html"><span>Explicit Nulls</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="experimental/main-annotation.html"><span>MainAnnotation</span></a></span></div><div class="ni n1"><span class="nh de"><button class="ar icon-button "></button><a href="experimental/capture-checking/index.html"><span>Capture Checking</span></a></span><div class="ni n2 "><span class="nh de"><a href="experimental/capture-checking/overview.html"><span>Tracked Capabilities Overview</span></a></span></div><div class="ni n2 "><span class="nh de"><a href="experimental/capture-checking/basics.html"><span>Capture Checking Basics</span></a></span></div><div class="ni n2 "><span class="nh de"><a href="experimental/capture-checking/classes.html"><span>Capture Checking of Classes</span></a></span></div><div class="ni n2 "><span class="nh de"><a href="experimental/capture-checking/polymorphism.html"><span>Capability Polymorphism</span></a></span></div><div class="ni n2 "><span class="nh de"><a href="experimental/capture-checking/scoped-capabilities.html"><span>Scoped Capabilities</span></a></span></div><div class="ni n2 "><span class="nh de"><a href="experimental/capture-checking/classifiers.html"><span>Capability Classifiers</span></a></span></div><div class="ni n2 "><span class="nh de"><a href="experimental/capture-checking/checked-exceptions.html"><span>Checked Exceptions</span></a></span></div><div class="ni n2 "><span class="nh de"><a href="experimental/capture-checking/mutability.html"><span>Stateful Capabilities</span></a></span></div><div class="ni n2 "><span class="nh de"><a href="experimental/capture-checking/separation-checking.html"><span>Separation Checking</span></a></span></div><div class="ni n2 "><span class="nh de"><a href="experimental/capture-checking/safe.html"><span>Safe Mode</span></a></span></div><div class="ni n2 "><span class="nh de"><a href="experimental/capture-checking/how-to-use.html"><span>How to Use the Capture Checker</span></a></span></div><div class="ni n2 "><span class="nh de"><a href="experimental/capture-checking/internals.html"><span>Capture Checking Internals</span></a></span></div></div><div class="ni n1 "><span class="nh de"><a href="experimental/purefuns.html"><span>Pure Function Syntax</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="experimental/tupled-function.html"><span>Tupled Function</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="experimental/modularity.html"><span>Modularity Improvements</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="experimental/typeclasses.html"><span>Better Support for Type Classes</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="experimental/quoted-patterns-with-polymorphic-functions.html"><span>Quoted Patterns with Polymorphic Functions</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="experimental/sub-cases.html"><span>Match Expressions with Sub Cases</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="experimental/dedented-string-literals.html"><span>Dedented String Literals</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="experimental/spec-strings.html"><span>Spec Strings</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="experimental/inline-traits.html"><span>inline-traits</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="experimental/specialized-traits.html"><span>specialized-traits</span></a></span></div></div><div class="ni n0 "><span class="nh de"><a href="syntax.html"><span>Scala 3 Syntax Summary</span></a></span></div><div class="ni n0"><span class="nh de"><button class="ar icon-button "></button><a href="language-versions/index.html"><span>Language Versions</span></a></span><div class="ni n1 "><span class="nh de"><a href="language-versions/source-compatibility.html"><span>Source Compatibility</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="language-versions/binary-compatibility.html"><span>Binary Compatibility</span></a></span></div></div><div class="ni n0 "><span class="nh de"><a href="soft-modifier.html"><span>Soft Keywords</span></a></span></div><div class="ni n0 expanded"><span class="nh h100 selected de"><a href="#"><span>A Classification of Proposed Language Features</span></a></span></div><div class="ni n0"><span class="nh de"><button class="ar icon-button "></button><a href="error-codes/index.html"><span>Error codes</span></a></span><div class="ni n1 "><span class="nh de"><a href="error-codes/E001.html"><span>E001: Empty Catch Block</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E002.html"><span>E002: Empty Catch And Finally Block</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E003.html"><span>E003: Deprecated With Operator</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E004.html"><span>E004: Case Class Missing Param List</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E005.html"><span>E005: Duplicate Bind</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E006.html"><span>E006: Missing Ident</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E007.html"><span>E007: Type Mismatch</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E008.html"><span>E008: Not A Member</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E009.html"><span>E009: Early Definitions Not Supported</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E010.html"><span>E010: Top Level Implicit Class</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E011.html"><span>E011: Implicit Case Class</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E012.html"><span>E012: Implicit Class Primary Constructor Arity</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E013.html"><span>E013: Object May Not Have Self Type</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E014.html"><span>E014: Tuple Too Long</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E015.html"><span>E015: Repeated Modifier</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E016.html"><span>E016: Interpolated String Error</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E017.html"><span>E017: Unbound Placeholder Parameter</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E018.html"><span>E018: Illegal Start Simple Expr</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E019.html"><span>E019: Missing Return Type</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E020.html"><span>E020: Yield Or Do Expected In For Comprehension</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E021.html"><span>E021: Proper Definition Not Found</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E022.html"><span>E022: By Name Parameter Not Supported</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E023.html"><span>E023: Wrong Number Of Type Args</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E024.html"><span>E024: Illegal Variable In Pattern Alternative</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E025.html"><span>E025: Identifier Expected</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E026.html"><span>E026: Auxiliary Constructor Needs Non-Implicit Parameter</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E027.html"><span>E027: Varargs Parameter Must Come Last</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E028.html"><span>E028: Illegal Literal</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E029.html"><span>E029: Pattern Match Exhaustivity</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E030.html"><span>E030: Match Case Unreachable</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E031.html"><span>E031: Sequence Wildcard Pattern Position</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E032.html"><span>E032: Illegal Start Of Simple Pattern</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E033.html"><span>E033: Package Duplicate Symbol</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E034.html"><span>E034: Existential Types No Longer Supported</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E035.html"><span>E035: Unbound Wildcard Type</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E036.html"><span>E036: Dangling This In Path</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E037.html"><span>E037: Overrides Nothing</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E038.html"><span>E038: Overrides Nothing But Name Exists</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E039.html"><span>E039: Forward Reference Extends Over Definition</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E040.html"><span>E040: Expected Token But Found</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E041.html"><span>E041: Mixed Left And Right Associative Ops</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E042.html"><span>E042: Cannot Instantiate Abstract Class Or Trait</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E043.html"><span>E043: Unreducible Application</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E044.html"><span>E044: Overloaded Or Recursive Method Needs Result Type</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E045.html"><span>E045: Recursive Value Needs Result Type</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E046.html"><span>E046: Cyclic Reference Involving</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E047.html"><span>E047: Cyclic Reference Involving Implicit</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E048.html"><span>E048: Super Qualifier Must Be Parent</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E049.html"><span>E049: Ambiguous Reference</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E050.html"><span>E050: Method Does Not Take Parameters</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E051.html"><span>E051: Ambiguous Overload</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E052.html"><span>E052: Reassignment To Val</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E053.html"><span>E053: Type Does Not Take Parameters</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E054.html"><span>E054: Parameterized Type Lacks Arguments</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E055.html"><span>E055: Var Val Parameters May Not Be Call By Name</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E056.html"><span>E056: Missing Type Parameter For</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E057.html"><span>E057: Does Not Conform To Bound</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E058.html"><span>E058: Does Not Conform To Self Type</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E059.html"><span>E059: Does Not Conform To Self Type Cannot Be Instantiated</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E060.html"><span>E060: Abstract Member May Not Have Modifier</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E061.html"><span>E061: Top Level Can't Be Implicit</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E062.html"><span>E062: Types And Traits Cannot Be Implicit</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E063.html"><span>E063: Only Classes Can Be Abstract</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E064.html"><span>E064: Abstract Override Only In Traits</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E065.html"><span>E065: Traits May Not Be Final</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E066.html"><span>E066: Native Members May Not Have Implementation</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E067.html"><span>E067: Only Classes Can Have Declared But Undefined Members</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E068.html"><span>E068: Cannot Extend AnyVal</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E069.html"><span>E069: Cannot Have Same Name As</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E070.html"><span>E070: Value Classes May Not Define Inner Class</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E071.html"><span>E071: Value Classes May Not Define Non Parameter Field</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E072.html"><span>E072: Value Classes May Not Define A Secondary Constructor</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E073.html"><span>E073: Value Classes May Not Contain Initialization</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E074.html"><span>E074: Value Classes May Not Be Abstract</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E075.html"><span>E075: Value Classes May Not Be Contained</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E076.html"><span>E076: Value Classes May Not Wrap Another Value Class</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E077.html"><span>E077: Value Class Parameter May Not Be A Var</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E078.html"><span>E078: Value Class Needs Exactly One Val Parameter</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E079.html"><span>E079: Only Case Class Or Case Object Allowed</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E080.html"><span>E080: Expected Top Level Def</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E081.html"><span>E081: Anonymous Function Missing Parameter Type</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E082.html"><span>E082: Super Calls Not Allowed In Inlineable</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E083.html"><span>E083: Not A Path</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E084.html"><span>E084: Wildcard On Type Argument Not Allowed On New</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E085.html"><span>E085: Function Type Needs Non-Empty Parameter List</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E086.html"><span>E086: Wrong Number Of Parameters</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E087.html"><span>E087: Duplicate Private Protected Qualifier</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E088.html"><span>E088: Expected Start Of Top Level Definition</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E089.html"><span>E089: Missing Return Type With Return Statement</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E090.html"><span>E090: No Return From Inlineable</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E091.html"><span>E091: Return Outside Method Definition</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E092.html"><span>E092: Unchecked Type Pattern</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E093.html"><span>E093: Extend Final Class</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E094.html"><span>E094: Enum Case Definition In Non-Enum Owner</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E095.html"><span>E095: Expected Type Bound Or Equals</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E096.html"><span>E096: Class And Companion Name Clash</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E097.html"><span>E097: Tailrec Not Applicable</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E098.html"><span>E098: Failure To Eliminate Existential</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E099.html"><span>E099: Only Functions Can Be Followed By Underscore</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E100.html"><span>E100: Missing Empty Argument List</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E101.html"><span>E101: Duplicate Named Type Parameter</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E102.html"><span>E102: Undefined Named Type Parameter</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E103.html"><span>E103: Illegal Start of Statement</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E104.html"><span>E104: Trait Is Expected</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E105.html"><span>E105: Trait Redefined Final Method From AnyRef</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E106.html"><span>E106: Package Name Already Defined</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E107.html"><span>E107: Unapply Invalid Number of Arguments</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E108.html"><span>E108: Unapply Invalid Return Type</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E109.html"><span>E109: Static Fields Only Allowed in Objects</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E110.html"><span>E110: Cyclic Inheritance</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E111.html"><span>E111: Bad Symbolic Reference</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E112.html"><span>E112: Unable to Extend Sealed Class</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E113.html"><span>E113: Symbol Has Unparsable Version Number</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E114.html"><span>E114: Symbol Changed Semantics In Version</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E115.html"><span>E115: Unable to Emit Switch</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E116.html"><span>E116: Missing Companion for Static</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E117.html"><span>E117: Polymorphic Method Missing Type in Parent</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E118.html"><span>E118: Params No Inline</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E119.html"><span>E119: Symbol Is Not a Value</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E120.html"><span>E120: Double Definition</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E121.html"><span>E121: Match Case Only Null Warning</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E122.html"><span>E122: Imported Twice</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E123.html"><span>E123: Type Test Always Diverges</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E124.html"><span>E124: Term Member Needs Result Type for Implicit Search</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E125.html"><span>E125: Class Cannot Extend Enum</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E126.html"><span>E126: Value Class Parameter May Not Be Call-By-Name</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E127.html"><span>E127: Not An Extractor</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E128.html"><span>E128: Member With Same Name As Static</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E129.html"><span>E129: Pure Expression In Statement Position</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E130.html"><span>E130: Trait Companion With Mutable Static</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E131.html"><span>E131: Lazy Static Field</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E132.html"><span>E132: Static Overriding Non-Static Members</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E133.html"><span>E133: Overload In Refinement</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E134.html"><span>E134: No Matching Overload</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E135.html"><span>E135: Stable Identifier Pattern</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E136.html"><span>E136: Static Fields Should Precede Non-Static</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E137.html"><span>E137: Illegal Super Accessor</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E138.html"><span>E138: Trait Parameter Used As Parent Prefix</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E139.html"><span>E139: Unknown Named Enclosing Class Or Object</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E140.html"><span>E140: Illegal Cyclic Type Reference</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E141.html"><span>E141: Missing Type Parameter In Type App</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E142.html"><span>E142: Skolem in Inferred</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E143.html"><span>E143: Erased Types Can Only Be Function Types</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E144.html"><span>E144: Case Class Missing Non-Implicit Parameter List</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E145.html"><span>E145: Enumerations Should Not Be Empty</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E146.html"><span>E146: Illegal Parameter Initialization</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E147.html"><span>E147: Redundant Modifier</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E148.html"><span>E148: Typed Case Does Not Explicitly Extend Typed Enum</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E149.html"><span>E149: Illegal Redefinition Of Standard Kind</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E150.html"><span>E150: No Extension Method Allowed</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E151.html"><span>E151: Extension Method Cannot Have Type Parameters</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E152.html"><span>E152: Extension Can Only Have Defs</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E153.html"><span>E153: Unexpected Pattern For SummonFrom</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E154.html"><span>E154: Anonymous Instance Cannot Be Empty</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E155.html"><span>E155: Type Splice in Val Pattern</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E156.html"><span>E156: Modifier Not Allowed For Definition</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E157.html"><span>E157: Cannot Extend Java Enum</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E158.html"><span>E158: Invalid Reference In ImplicitNotFound Annotation</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E159.html"><span>E159: Trait May Not Define Native Method</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E160.html"><span>E160: Java Enum Parent Args</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E161.html"><span>E161: Already Defined</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E162.html"><span>E162: Case Class In Inlined Code</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E163.html"><span>E163: Override Type Mismatch Error</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E164.html"><span>E164: Override Error</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E165.html"><span>E165: Matchable Warning</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E166.html"><span>E166: Cannot Extend Function</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E167.html"><span>E167: Lossy Widening Constant Conversion</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E168.html"><span>E168: Implicit Search Too Large</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E169.html"><span>E169: TargetName On Top-Level Class</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E170.html"><span>E170: Not Class Type</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E171.html"><span>E171: Missing Argument</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E172.html"><span>E172: Missing Implicit Argument</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E173.html"><span>E173: Cannot Be Accessed</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E174.html"><span>E174: Inline Given Should Not Be Function</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E175.html"><span>E175: Value Discarding</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E176.html"><span>E176: Unused Non-Unit Value</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E177.html"><span>E177: Constructor Proxy Shadows</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E178.html"><span>E178: Missing Argument List</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E179.html"><span>E179: Match Type Scrutinee Cannot Be Higher-Kinded</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E180.html"><span>E180: Ambiguous Extension Method</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E181.html"><span>E181: Unqualified Call to AnyRef Method</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E182.html"><span>E182: Not Constant</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E183.html"><span>E183: Closure Cannot Have Internal Parameter Dependencies</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E184.html"><span>E184: Match Type No Cases</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E185.html"><span>E185: Unimported and Imported</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E186.html"><span>E186: Implausible Pattern Warning</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E187.html"><span>E187: Synchronized Call on Boxed Class</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E188.html"><span>E188: VarArgs Param Cannot Be Given</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E189.html"><span>E189: Extractor Not Found</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E190.html"><span>E190: Pure Unit Expression</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E191.html"><span>E191: Match Type Legacy Pattern</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E192.html"><span>E192: Unstable Inline Accessor</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E193.html"><span>E193: Volatile on Val</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E194.html"><span>E194: Extension Nullified by Member</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E195.html"><span>E195: Phantom Symbol Not Value</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E196.html"><span>E196: Context Bound Companion Not Value</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E197.html"><span>E197: Inlined Anonymous Class Warning</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E198.html"><span>E198: Unused Symbol</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E199.html"><span>E199: Tailrec Nested Call</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E200.html"><span>E200: Final Local Def</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E201.html"><span>E201: Non-Named Argument in Java Annotation</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E202.html"><span>E202: Quoted Type Missing</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E203.html"><span>E203: Deprecated Assignment Syntax</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E204.html"><span>E204: Deprecated Infix Named Argument Syntax</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E205.html"><span>E205: Given Search Priority Warning</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E206.html"><span>E206: Enum May Not Be Value Class</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E207.html"><span>E207: Illegal Unroll Placement</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E208.html"><span>E208: Extension Has Default Receiver</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E209.html"><span>E209: Format Interpolation Error</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E210.html"><span>E210: Value Class Cannot Extend Alias of AnyVal</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E211.html"><span>E211: Match Is Not Partial Function</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E212.html"><span>E212: Only Fully Dependent Applied Constructor Type</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E213.html"><span>E213: Pointless Applied Constructor Type</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E214.html"><span>E214: Illegal Context Bounds</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E215.html"><span>E215: Named Pattern Not Applicable</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E216.html"><span>E216: Unnecessary .nn</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E217.html"><span>E217: Erased Not Pure</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E218.html"><span>E218: Illegal Erased Definition</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E219.html"><span>E219: Cannot Instantiate Quoted Type Variable</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E220.html"><span>E220: Default Shadows Given</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E221.html"><span>E221: Recurse With Default</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E222.html"><span>E222: Encoded Package Name</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E223.html"><span>E223: Cannot Be Included in Capture Set</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E224.html"><span>E224: Override Class</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E225.html"><span>E225: Infer Union Warning</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E226.html"><span>E226: Type Parameter Shadows Type</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E227.html"><span>E227: Private Shadows Type</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E228.html"><span>E228: Names With Trailing Colon</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E229.html"><span>E229: Indentation Does Not Reflect Nesting</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E230.html"><span>E230: Illegal Identifier</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E231.html"><span>'E231: Concrete Class Has Unimplemented Methods'</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E232.html"><span>E232: Use of Interpolator from Any</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E233.html"><span>E233: Illegal Use of Specialized Error</span></a></span></div><div class="ni n1 "><span class="nh de"><a href="error-codes/E234.html"><span>E234: Variance in Specialized Traits Limitation</span></a></span></div></div></nav></div><div id="footer" class="body-small"><div class="left-container">Generated with</div><div class="right-container"><a href="https://github.com/scala/scala3"><button class="icon-button gh"></button></a><a href="https://discord.com/invite/scala"><button class="icon-button discord"></button></a><a href="https://twitter.com/scala_lang"><button class="icon-button twitter"></button></a><div class="text">Copyright (c) 2002-2026, LAMP/EPFL</div></div><div class="text-mobile">Copyright (c) 2002-2026, LAMP/EPFL</div></div><div id="scaladoc-searchBar"></div><div id="main"><div class="breadcrumbs container"><a href="index.html">Scala 3 Reference</a>/<a href="features-classification.html">A Classification of Proposed Language Features</a></div><div id="content" class="body-medium"><div><div id="content-wrapper">
<div class="site-container">
<div id="site-header"></div>
<main>
<header>
<a class="text-button with-link body-small" href="https://github.com/scala/scala3/edit/language-reference-stable/docs/_docs/reference/features-classification.md">Edit this page on GitHub</a>
<h1 class="h600">A Classification of Proposed Language Features</h1>
</header>
<p class="body-large first-p">This document provides an overview of the constructs proposed for Scala 3 with the aim to facilitate the discussion what to include and when to include it. It classifies features into eight groups: (1) essential foundations, (2) simplifications, (3) restrictions, (4) dropped features, (5) changed features, (6) new features, (7) features oriented towards metaprogramming with the aim to replace existing macros, and (8) changes to type checking and inference.</p>
<p>Each group contains sections classifying the status (i.e. relative importance to be a part of Scala 3, and relative urgency when to decide this) and the migration cost of the constructs in it.</p>
<p>The current document reflects the state of things as of April, 2019. It will be updated to reflect any future changes in that status.</p>
<section id="essential-foundations">
<h2 class="h500"><a href="#essential-foundations" class="anchor"></a>Essential Foundations</h2>
<p>These new constructs directly model core features of <a href="https://www.scala-lang.org/blog/2016/02/03/essence-of-scala.html">DOT</a>, higher-kinded types, and the <a href="https://infoscience.epfl.ch/record/229878/files/simplicitly_1.pdf">SI calculus for implicit resolution</a>.</p>
<ul>
<li><a href="new-types/intersection-types.html">Intersection types</a>, replacing compound types,</li>
<li><a href="new-types/union-types.html">Union types</a>,</li>
<li><a href="new-types/type-lambdas.html">Type lambdas</a>, replacing encodings using structural types and type projection.</li>
<li><a href="contextual/context-functions.html">Context functions</a> offering abstraction over given parameters.</li>
</ul>
<p><strong>Status: essential</strong></p>
<p>These are essential core features of Scala 3. Without them, Scala 3 would be a completely different language, with different foundations.</p>
<p><strong>Migration cost: none to low</strong></p>
<p>Since these are additions, there's generally no migration cost for old code. An exception are intersection types which replace compound types with slightly cleaned-up semantics. But few programs would be affected by this change.</p>
</section>
<section id="simplifications">
<h2 class="h500"><a href="#simplifications" class="anchor"></a>Simplifications</h2>
<p>These constructs replace existing constructs with the aim of making the language safer and simpler to use, and to promote uniformity in code style.</p>
<ul>
<li><a href="other-new-features/trait-parameters.html">Trait parameters</a> replace <a href="dropped-features/early-initializers.html">early initializers</a> with a more generally useful construct.</li>
<li><a href="contextual/givens.html">Given instances</a> replace implicit objects and defs, focussing on intent over mechanism.</li>
<li><a href="contextual/using-clauses.html">Using clauses</a> replace implicit parameters, avoiding their ambiguities.</li>
<li><a href="contextual/extension-methods.html">Extension methods</a> replace implicit classes with a clearer and simpler mechanism.</li>
<li><a href="other-new-features/opaques.html">Opaque type aliases</a> replace most uses of value classes while guaranteeing absence of boxing.</li>
<li><a href="other-new-features/toplevel-definitions.html">Top-level definitions</a> replace package objects, dropping syntactic boilerplate.</li>
<li><a href="other-new-features/export.html">Export clauses</a> provide a simple and general way to express aggregation, which can replace the previous facade pattern of package objects inheriting from classes.</li>
<li><a href="changed-features/vararg-splices.html">Vararg splices</a> now use the form <code>*</code> instead of <code>@ _*</code>, mirroring vararg expressions,</li>
<li><a href="other-new-features/creator-applications.html">Creator applications</a> allow using simple function call syntax instead of <code>new</code> expressions. <code>new</code> expressions stay around as a fallback for the cases where creator applications cannot be used.</li>
</ul>
<p>With the exception of early initializers and old-style vararg splices, all superseded constructs continue to be available in Scala 3.0. The plan is to deprecate and phase them out later.</p>
<p>Value classes (superseded by opaque type aliases) are a special case. There are currently no deprecation plans for value classes, since we might bring them back in a more general form if they are supported natively by the JVM as is planned by project Valhalla.</p>
<p><strong>Status: bimodal: now or never / can delay</strong></p>
<p>These are essential simplifications. If we decide to adopt them, we should do it for 3.0. Otherwise we are faced with the awkward situation that the Scala 3 documentation has to describe an old feature that will be replaced or superseded by a simpler one in the future.</p>
<p>On the other hand, we need to decide now only about the new features in this list. The decision to drop the superseded features can be delayed. Of course, adopting a new feature without deciding to drop the superseded feature will make the language larger.</p>
<p><strong>Migration cost: moderate</strong></p>
<p>For the next several versions, old features will remain available and deprecation and rewrite techniques can make any migration effort low and gradual.</p>
</section>
<section id="restrictions">
<h2 class="h500"><a href="#restrictions" class="anchor"></a>Restrictions</h2>
<p>These constructs are restricted to make the language safer.</p>
<ul>
<li><a href="contextual/conversions.html">Implicit Conversions</a>: there is only one way to define implicit conversions instead of many, and potentially surprising implicit conversions require a language import.</li>
<li><a href="contextual/given-imports.html">Given Imports</a>: implicits now require a special form of import, to make the import clearly visible.</li>
<li><a href="dropped-features/type-projection.html">Type Projection</a>: only classes can be used as prefix <code>C</code> of a type projection <code>C#A</code>. Type projection on abstract types is no longer supported since it is unsound.</li>
<li><a href="contextual/multiversal-equality.html">Multiversal equality</a> implements an "opt-in" scheme to rule out nonsensical comparisons with <code>==</code> and <code>!=</code>.</li>
<li><a href="https://github.com/scala/scala3/pull/5975">infix</a> makes method application syntax uniform across code bases.</li>
</ul>
<p>Unrestricted implicit conversions continue to be available in Scala 3.0, but will be deprecated and removed later. Unrestricted versions of the other constructs in the list above are available only under <code>-source 3.0-migration</code>.</p>
<p><strong>Status: now or never</strong></p>
<p>These are essential restrictions. If we decide to adopt them, we should do it for 3.0. Otherwise we are faced with the awkward situation that the Scala 3 documentation has to describe a feature that will be restricted in the future.</p>
<p><strong>Migration cost: low to high</strong></p>
<ul>
<li><em>low</em>: multiversal equality rules out code that is nonsensical, so any rewrites required by its adoption should be classified as bug fixes.</li>
<li><em>moderate</em>: Restrictions to implicits can be accommodated by straightforward rewriting.</li>
<li><em>high</em>: Unrestricted type projection cannot always rewritten directly since it is unsound in general.</li>
</ul>
</section>
<section id="dropped-constructs">
<h2 class="h500"><a href="#dropped-constructs" class="anchor"></a>Dropped Constructs</h2>
<p>These constructs are proposed to be dropped without a new construct replacing them. The motivation for dropping these constructs is to simplify the language and its implementation.</p>
<ul>
<li><a href="dropped-features/delayed-init.html">DelayedInit</a>,</li>
<li><a href="dropped-features/existential-types.html">Existential types</a>,</li>
<li><a href="dropped-features/procedure-syntax.html">Procedure syntax</a>,</li>
<li><a href="dropped-features/class-shadowing.html">Class shadowing</a>,</li>
<li><a href="dropped-features/xml.html">XML literals</a>,</li>
<li><a href="dropped-features/symlits.html">Symbol literals</a>,</li>
<li><a href="dropped-features/auto-apply.html">Auto application</a>,</li>
<li><a href="dropped-features/weak-conformance.html">Weak conformance</a>,</li>
<li><a href="new-types/intersection-types.html">Compound types</a>,</li>
<li><a href="https://github.com/scala/scala3/pull/4311">Auto tupling</a> (implemented, but not merged).</li>
</ul>
<p>The date when these constructs are dropped varies. The current status is:</p>
<ul>
<li>Not implemented at all:
<ul>
<li>DelayedInit, existential types, weak conformance.</li>
</ul></li>
<li>Supported under <code>-source 3.0-migration</code>:
<ul>
<li>procedure syntax, class shadowing, symbol literals, auto application, auto tupling in a restricted form.</li>
</ul></li>
<li>Supported in 3.0, to be deprecated and phased out later:
<ul>
<li>XML literals, compound types.</li>
</ul></li>
</ul>
<p><strong>Status: mixed</strong></p>
<p>Currently unimplemented features would require considerable implementation effort which would in most cases make the compiler more buggy and fragile and harder to understand. If we do not decide to drop them, they will probably show up as "not yet implemented" in the Scala 3.0 release.</p>
<p>Currently implemented features could stay around indefinitely. Updated docs may simply ignore them, in the expectation that they might go away eventually. So the decision about their removal can be delayed.</p>
<p><strong>Migration cost: moderate to high</strong></p>
<p>Dropped features require rewrites to avoid their use in programs. These rewrites can sometimes be automatic (e.g. for procedure syntax, symbol literals, auto application) and sometimes need to be manual (e.g. class shadowing, auto tupling). Sometimes the rewrites would have to be non-local, affecting use sites as well as definition sites (e.g., in the case of <code>DelayedInit</code>, unless we find a solution).</p>
</section>
<section id="changes">
<h2 class="h500"><a href="#changes" class="anchor"></a>Changes</h2>
<p>These constructs have undergone changes to make them more regular and useful.</p>
<ul>
<li><a href="changed-features/structural-types.html">Structural Types</a>: They now allow pluggable implementations, which greatly increases their usefulness. Some usage patterns are restricted compared to the status quo.</li>
<li><a href="changed-features/pattern-matching.html">Name-based pattern matching</a>: The existing undocumented Scala 2 implementation has been codified in a slightly simplified form.</li>
<li><a href="changed-features/eta-expansion.html">Eta expansion</a> is now performed universally also in the absence of an expected type. The postfix <code>_</code> operator is thus made redundant. It will be deprecated and dropped after Scala 3.0.</li>
<li><a href="changed-features/implicit-resolution.html">Implicit Resolution</a>: The implicit resolution rules have been cleaned up to make them more useful and less surprising. Implicit scope is restricted to no longer include package prefixes.</li>
</ul>
<p>Most aspects of old-style implicit resolution are still available under <code>-source 3.0-migration</code>. The other changes in this list are applied unconditionally.</p>
<p><strong>Status: strongly advisable</strong></p>
<p>The features have been implemented in their new form in Scala 3.0's compiler. They provide clear improvements in simplicity and functionality compared to the status quo. Going back would require significant implementation effort for a net loss of functionality.</p>
<p><strong>Migration cost: low to high</strong></p>
<p>Only a few programs should require changes, but some necessary changes might be non-local (as in the case of restrictions to implicit scope).</p>
</section>
<section id="new-constructs">
<h2 class="h500"><a href="#new-constructs" class="anchor"></a>New Constructs</h2>
<p>These are additions to the language that make it more powerful or pleasant to use.</p>
<ul>
<li><a href="enums/enums.html">Enums</a> provide concise syntax for enumerations and <a href="enums/adts.html">algebraic data types</a>.</li>
<li><a href="other-new-features/parameter-untupling.html">Parameter untupling</a> avoids having to use <code>case</code> for tupled parameter destructuring.</li>
<li><a href="new-types/dependent-function-types.html">Dependent function types</a> generalize dependent methods to dependent function values and types.</li>
<li><a href="https://github.com/scala/scala3/pull/4672">Polymorphic function types</a> generalize polymorphic methods to dependent function values and types. <em>Current status</em>: There is a proposal, and a prototype implementation, but the implementation has not been finalized or merged yet.</li>
<li><a href="other-new-features/kind-polymorphism.html">Kind polymorphism</a> allows the definition of operators working equally on types and type constructors.</li>
</ul>
<p><strong>Status: mixed</strong></p>
<p>Enums offer an essential simplification of fundamental use patterns, so they should be adopted for Scala 3.0. Auto-parameter tupling is a very small change that removes some awkwardness, so it might as well be adopted now. The other features constitute more specialized functionality which could be introduced in later versions. On the other hand, except for polymorphic function types they are all fully implemented, so if the Scala 3.0 spec does not include them, they might be still made available under a language flag.</p>
<p><strong>Migration cost: none</strong></p>
<p>Being new features, existing code migrates without changes. To be sure, sometimes it would be attractive to rewrite code to make use of the new features in order to increase clarity and conciseness.</p>
</section>
<section id="metaprogramming">
<h2 class="h500"><a href="#metaprogramming" class="anchor"></a>Metaprogramming</h2>
<p>The following constructs together aim to put metaprogramming in Scala on a new basis. So far, metaprogramming was achieved by a combination of macros and libraries such as <a href="https://github.com/milessabin/shapeless">Shapeless</a> that were in turn based on some key macros. Current Scala 2 macro mechanisms are a thin veneer on top the current Scala 2 compiler, which makes them fragile and in many cases impossible to port to Scala 3.</p>
<p>It's worth noting that macros were never included in the <a href="https://scala-lang.org/files/archive/spec/2.13/">Scala 2 language specification</a> and were so far made available only under an <code>-experimental</code> flag. This has not prevented their widespread usage.</p>
<p>To enable porting most uses of macros, we are experimenting with the advanced language constructs listed below. These designs are more provisional than the rest of the proposed language constructs for Scala 3.0. There might still be some changes until the final release. Stabilizing the feature set needed for metaprogramming is our first priority.</p>
<ul>
<li><a href="new-types/match-types.html">Match types</a> allow computation on types.</li>
<li><a href="metaprogramming/inline.html">Inline</a> provides by itself a straightforward implementation of some simple macros and is at the same time an essential building block for the implementation of complex macros.</li>
<li><a href="metaprogramming/macros.html">Quotes and splices</a> provide a principled way to express macros and staging with a unified set of abstractions.</li>
<li><a href="contextual/derivation.html">Type class derivation</a> provides an in-language implementation of the <code>Gen</code> macro in Shapeless and other foundational libraries. The new implementation is more robust, efficient and easier to use than the macro.</li>
<li><a href="contextual/by-name-context-parameters.html">Implicit by-name parameters</a> provide a more robust in-language implementation of the <code>Lazy</code> macro in Shapeless.</li>
</ul>
<p><strong>Status: not yet settled</strong></p>
<p>We know we need a practical replacement for current macros. The features listed above are very promising in that respect, but we need more complete implementations and more use cases to reach a final verdict.</p>
<p><strong>Migration cost: very high</strong></p>
<p>Existing macro libraries will have to be rewritten from the ground up. In many cases the rewritten libraries will turn out to be simpler and more robust than the old ones, but that does not relieve one of the cost of the rewrites. It's currently unclear to what degree users of macro libraries will be affected. We aim to provide sufficient functionality so that core macros can be re-implemented fully, but given the vast feature set of the various macro extensions to Scala 2 it is difficult to arrive at a workable limitation of scope.</p>
</section>
<section id="changes-to-type-checking-and-inference">
<h2 class="h500"><a href="#changes-to-type-checking-and-inference" class="anchor"></a>Changes to Type Checking and Inference</h2>
<p>The Scala 3 compiler uses a new algorithm for type inference, which relies on a general subtype constraint solver. The new algorithm often <a href="https://contributors.scala-lang.org/t/better-type-inference-for-scala-send-us-your-problematic-cases/2410">works better than the old</a>, but there are inevitably situations where the results of both algorithms differ, leading to errors diagnosed by Scala 3 for programs that the Scala 2 compiler accepts.</p>
<p><strong>Status: essential</strong></p>
<p>The new type-checking and inference algorithms are the essential core of the new compiler. They cannot be reverted without dropping the whole implementation of Scala 3.</p>
<p><strong>Migration cost: high</strong></p>
<p>Some existing programs will break and, given the complex nature of type inference, it will not always be clear what change caused the breakage and how to fix it.</p>
<p>In our experience, macros and changes in type and implicit argument inference together cause the large majority of problems encountered when porting existing code to Scala 3. The latter source of problems could be addressed systematically by a tool that added all inferred types and implicit arguments to a Scala 2 source code file. Most likely such a tool would be implemented as a <a href="https://docs.scala-lang.org/overviews/plugins/index.html">Scala 2 compiler plugin</a>. The resulting code would have a greatly increased likelihood to compile under Scala 3, but would often be bulky to the point of being unreadable. A second part of the rewriting tool should then selectively and iteratively remove type and implicit annotations that were synthesized by the first part as long as they compile under Scala 3. This second part could be implemented as a program that invokes the Scala 3 compiler <code>scalac</code> programmatically.</p>
<p>Several people have proposed such a tool for some time now. I believe it is time we find the will and the resources to actually implement it.</p>
</section>
</main>
<div class="divider">
<nav class="arrow-navigation" aria-label="Page navigation">
<div>
<span class="body-small">Previous</span> <a rel="prev" href="soft-modifier.html" aria-keyshortcuts="Left" class="body-medium"> <span class="body-medium">Soft Keywords</span> </a>
</div>
<div>
<span class="body-small arrow-navigation--next">Next</span> <a rel="next" href="error-codes/index.html" aria-keyshortcuts="Right" class="body-medium"> <span class="body-medium">Error codes</span> </a>
</div>
</nav>
<div class="content-contributors hidden">
<h1 class="h200">Contributors to this page</h1>
<div id="documentation-contributors" class="contributors-container"></div>
<div class="github-edit-button">
<a class="text-button with-link body-small" href="https://github.com/scala/scala3/edit/language-reference-stable/docs/_docs/reference/features-classification.md"> Edit this page on GitHub </a>
</div>
</div>
</div>
</div>
</div></div><div id="toc" class="body-small"><div id="toc-container"><span class="toc-title h200">In this article</span><nav class="toc-nav"><ul class="toc-list"><li><a href="#essential-foundations">Essential Foundations</a></li><li><a href="#simplifications">Simplifications</a></li><li><a href="#restrictions">Restrictions</a></li><li><a href="#dropped-constructs">Dropped Constructs</a></li><li><a href="#changes">Changes</a></li><li><a href="#new-constructs">New Constructs</a></li><li><a href="#metaprogramming">Metaprogramming</a></li><li><a href="#changes-to-type-checking-and-inference">Changes to Type Checking and Inference</a></li></ul></nav></div></div></div><div id="footer" class="body-small mobile-footer"><div class="left-container">Generated with</div><div class="right-container"><a href="https://github.com/scala/scala3"><button class="icon-button gh"></button></a><a href="https://discord.com/invite/scala"><button class="icon-button discord"></button></a><a href="https://twitter.com/scala_lang"><button class="icon-button twitter"></button></a><div class="text">Copyright (c) 2002-2026, LAMP/EPFL</div></div><div class="text-mobile">Copyright (c) 2002-2026, LAMP/EPFL</div></div></div></div></body></html>