Meta tags:
Headings (most frequently used words):
constructs, scala, reference, contributors, to, this, page, goals, essential, foundations, simplifications, restrictions, dropped, changes, new, metaprogramming, see, also,
Text of the page (most frequently used words):
type (63), the (58), and (56), not (47), types (35), class (31), scala (26), implicit (26), constructs (23), #dropped (23), parameter (23), value (22), language (21), classes (20), with (19), for (18), cannot (18), function (16), missing (16), may (16), new (15), pattern (15), are (14), only (14), method (14), reference (14), name (13), syntax (13), this (12), case (12), illegal (12), changes (11), more (11), parameters (11), macros (11), match (11), make (11), implementation (10), these (10), have (10), expected (9), definition (9), literals (9), symbol (9), extension (9), trait (9), non (9), static (9), metaprogramming (8), use (8), methods (8), package (8), can (8), given (8), replace (8), named (8), extend (8), context (7), other (7), top (7), list (7), deprecated (7), supported (7), enum (7), argument (7), that (6), features (6), them (6), polymorphic (6), but (6), resolution (6), conversions (6), abstract (6), call (6), objects (6), level (6), definitions (6), warning (6), capture (6), constructor (6), allowed (6), empty (6), does (6), needs (6), return (6), provide (5), simple (5), inline (5), final (5), available (5), has (5), dependent (5), form (5), auto (5), application (5), existential (5), projection (5), define (5), using (5), arguments (5), error (5), member (5), val (5), modifier (5), wildcard (5), checking (5), copyright (4), 2002 (4), 2026 (4), lamp (4), epfl (4), foundations (4), goals (4), page (4), status (4), migration (4), proposed (4), macro (4), easier (4), some (4), there (4), under (4), experimental (4), current (4), cases (4), code (4), source (4), restricted (4), now (4), patterns (4), safer (4), opaque (4), aliases (4), early (4), expressions (4), from (4), clauses (4), over (4), functions (4), shadows (4), override (4), erased (4), pure (4), annotation (4), companion (4), parent (4), initialization (4), cyclic (4), overload (4), number (4), start (4), duplicate (4), traits (4), capabilities (4), also (3), restrictions (3), simplifications (3), essential (3), version (3), construct (3), shapeless (3), lazy (3), way (3), set (3), splices (3), same (3), time (3), block (3), allow (3), most (3), were (3), their (3), which (3), many (3), targetname (3), kind (3), polymorphism (3), been (3), enumerations (3), enums (3), style (3), applied (3), useful (3), longer (3), eta (3), expansion (3), automatic (3), matching (3), structural (3), out (3), later (3), compound (3), xml (3), procedure (3), shadowing (3), delayedinit (3), weak (3), conformance (3), intersection (3), replacing (3), used (3), implicits (3), import (3), instead (3), general (3), vararg (3), initializers (3), apply (3), union (3), changed (3), private (3), default (3), quoted (3), search (3), java (3), anonymous (3), bound (3), found (3), ambiguous (3), should (3), invalid (3), object (3), super (3), members (3), statement (3), result (3), conform (3), self (3), givens (3), generated (2), see (2), edit (2), github (2), relative (2), when (2), classification (2), robust (2), provides (2), foundational (2), libraries (2), than (2), derivation (2), principled (2), express (2), abstractions (2), uses (2), might (2), still (2), priority (2), included (2), far (2), made (2), usage (2), aim (2), was (2), such (2), based (2), compiler (2), avoiding (2), operators (2), generalize (2), values (2), merged (2), inference (2), support (2), tupled (2), untupling (2), algebraic (2), data (2), powerful (2), old (2), rules (2), less (2), surprising (2), absence (2), operator (2), redundant (2), will (2), existing (2), they (2), compared (2), regular (2), tupling (2), implemented (2), all (2), dropping (2), unrestricted (2), continue (2), versions (2), infix (2), multiversal (2), equality (2), prefix (2), since (2), require (2), special (2), imports (2), one (2), superseded (2), universal (2), export (2), while (2), simpler (2), mechanism (2), defs (2), instances (2), lambdas (2), core (2), dot (2), higher (2), kinded (2), calculus (2), into (2), strengthen (2), remove (2), warts (2), increase (2), consistency (2), expressiveness (2), programming (2), work (2), main (2), improvements (2), instantiate (2), variable (2), applicable (2), bounds (2), anyval (2), def (2), tailrec (2), unused (2), inlined (2), accessor (2), unit (2), expression (2), extractor (2), varargs (2), param (2), imported (2), constant (2), anyref (2), too (2), matchable (2), mismatch (2), already (2), defined (2), args (2), native (2), typed (2), fields (2), identifier (2), field (2), position (2), unable (2), unapply (2), undefined (2), inlineable (2), protected (2), qualifier (2), wrong (2), path (2), var (2), take (2), must (2), involving (2), recursive (2), right (2), associative (2), overrides (2), nothing (2), unbound (2), catch (2), binary (2), compatibility (2), better (2), how (2), safe (2), capability (2), numeric (2), preview (2), details (2), blog (2), community (2), find (2), library (2), playground (2), install (2), learn (2), article, contributors, next, expanded, adds, importance, part, urgency, decide, cost, each, efficient, gen, staging, unified, quotes, itself, straightforward, building, complex, computation, enable, porting, experimenting, advanced, listed, below, designs, provisional, rest, until, release, stabilizing, feature, needed, our, first, worth, noting, never, flag, prevented, widespread, specification, following, together, put, basis, achieved, combination, turn, key, mechanisms, thin, veneer, makes, fragile, impossible, port, interoperate, written, languages, give, flexibility, clashes, annotations, allows, working, equally, constructors, proposal, prototype, finalized, notably, avoids, having, destructuring, concise, additions, pleasant, aspects, unconditionally, cleaned, scope, include, prefixes, performed, universally, postfix, thus, after, undocumented, codified, slightly, simplified, pluggable, implementations, greatly, increases, usefulness, quo, undergone, phased, date, varies, replaced, without, motivation, simplify, its, removed, above, uniform, across, bases, implement, opt, scheme, rule, nonsensical, comparisons, unsound, clearly, visible, potentially, currently, deprecation, plans, bring, back, natively, jvm, planned, project, valhalla, exception, plan, deprecate, phase, stay, around, fallback, where, creator, applications, aggregation, previous, facade, inheriting, syntactic, boilerplate, guaranteeing, boxing, clearer, ambiguities, focussing, intent, generally, making, promote, uniformity, offering, abstraction, encodings, directly, model, corresponding, fall, seven, categories, smaller, usability, fill, gaps, approach, replaces, further, improve, tame, gentler, learning, curve, puzzlers, full, compatible, lessons, learned, redesign, guided, three, implements, discuss, design, decisions, present, important, differences, e227, e226, e225, infer, e224, e223, e222, encoded, e221, recurse, e220, e219, e218, e217, e216, unnecessary, e215, e214, e213, pointless, e212, fully, e211, partial, e210, alias, e209, format, interpolation, e208, receiver, e207, unroll, placement, e206, e205, e204, e203, assignment, e202, e201, e200, local, e199, nested, e198, e197, e196, e195, phantom, e194, nullified, e193, volatile, e192, unstable, e191, legacy, e190, e189, e188, e187, synchronized, boxed, e186, implausible, e185, unimported, e184, e183, closure, internal, dependencies, e182, e181, unqualified, e180, e179, scrutinee, e178, e177, proxy, e176, e175, discarding, e174, e173, accessed, e172, e171, e170, e169, e168, large, e167, lossy, widening, conversion, e166, e165, e164, e163, e162, e161, e160, e159, e158, implicitnotfound, e157, e156, e155, splice, e154, instance, e153, unexpected, summonfrom, e152, e151, e150, e149, redefinition, standard, e148, explicitly, e147, e146, e145, e144, e143, e142, skolem, inferred, e141, app, e140, e139, unknown, enclosing, e138, e137, e136, precede, e135, stable, e134, e133, refinement, e132, overriding, e131, e130, mutable, e129, e128, e127, e126, e125, e124, term, e123, test, always, diverges, e122, twice, e121, null, e120, double, e119, e118, params, e117, e116, e115, emit, switch, e114, semantics, e113, unparsable, e112, sealed, e111, bad, symbolic, e110, inheritance, e109, e108, e107, e106, e105, redefined, e104, e103, e102, e101, e100, e099, followed, underscore, e098, failure, eliminate, e097, e096, clash, e095, equals, e094, owner, e093, e092, unchecked, e091, outside, e090, e089, e088, e087, e086, e085, e084, e083, e082, calls, e081, e080, e079, e078, exactly, e077, e076, wrap, another, e075, contained, e074, e073, contain, e072, secondary, e071, e070, inner, e069, e068, e067, declared, e066, e065, e064, e063, e062, e061, e060, e059, instantiated, e058, e057, e056, e055, e054, parameterized, lacks, e053, e052, reassignment, e051, e050, e049, e048, e047, e046, e045, e044, overloaded, e043, unreducible, e042, e041, mixed, left, ops, e040, token, e039, forward, extends, e038, exists, e037, e036, dangling, e035, e034, e033, e032, e031, sequence, e030, unreachable, e029, exhaustivity, e028, literal, e027, come, last, e026, auxiliary, e025, e024, alternative, e023, e022, e021, proper, e020, yield, comprehension, e019, e018, expr, e017, placeholder, e016, interpolated, string, e015, repeated, e014, tuple, long, e013, e012, primary, arity, e011, e010, e009, e008, e007, e006, ident, e005, bind, e004, e003, e002, finally, e001, codes, soft, keywords, summary, sub, relaxed, lambda, able, unrolling, modularity, internals, checker, mode, separation, stateful, checked, exceptions, classifiers, scoped, basics, tracked, overview, mainannotation, explicit, nulls, canthrow, initializer, nonlocal, returns, limit, escapes, interpolations, vals, plugins, option, bindings, programmatic, runtimechecked, fors, toplevel, integer, typetest, optional, braces, control, threadunsafe, generalized, open, tuples, transparent, tasty, inspection, reflection, run, multi, stage, meta, theory, symmetric, compile, operations, relationship, write, derived, implementing, forms, importing, deferred, contextual, translation, adts, docs,
Text of the page (random words):
ateful capabilities separation checking safe mode how to use the capture checker capture checking internals pure function syntax tupled function modularity improvements better support for type classes automatic parameter unrolling reference able package objects quoted patterns with polymorphic functions relaxed lambda syntax match expressions with sub cases scala 3 syntax summary language versions source compatibility binary compatibility soft keywords a classification of proposed language features error codes e001 empty catch block e002 empty catch and finally block e003 deprecated with operator e004 case class missing param list e005 duplicate bind e006 missing ident e007 type mismatch e008 not a member e009 early definitions not supported e010 top level implicit class e011 implicit case class e012 implicit class primary constructor arity e013 object may not have self type e014 tuple too long e015 repeated modifier e016 interpolated string error e017 unbound placeholder parameter e018 illegal start simple expr e019 missing return type e020 yield or do expected in for comprehension e021 proper definition not found e022 by name parameter not supported e023 wrong number of type args e024 illegal variable in pattern alternative e025 identifier expected e026 auxiliary constructor needs non implicit parameter e027 varargs parameter must come last e028 illegal literal e029 pattern match exhaustivity e030 match case unreachable e031 sequence wildcard pattern position e032 illegal start of simple pattern e033 package duplicate symbol e034 existential types no longer supported e035 unbound wildcard type e036 dangling this in path e037 overrides nothing e038 overrides nothing but name exists e039 forward reference extends over definition e040 expected token but found e041 mixed left and right associative ops e042 cannot instantiate abstract class or trait e043 unreducible application e044 overloaded or recursive method needs result type e045 recursive value needs result type e046 cyclic reference involving e047 cyclic reference involving implicit e048 super qualifier must be parent e049 ambiguous reference e050 method does not take parameters e051 ambiguous overload e052 reassignment to val e053 type does not take parameters e054 parameterized type lacks arguments e055 var val parameters may not be call by name e056 missing type parameter for e057 does not conform to bound e058 does not conform to self type e059 does not conform to self type cannot be instantiated e060 abstract member may not have modifier e061 top level can t be implicit e062 types and traits cannot be implicit e063 only classes can be abstract e064 abstract override only in traits e065 traits may not be final e066 native members may not have implementation e067 only classes can have declared but undefined members e068 cannot extend anyval e069 cannot have same name as e070 value classes may not define inner class e071 value classes may not define non parameter field e072 value classes may not define a secondary constructor e073 value classes may not contain initialization e074 value classes may not be abstract e075 value classes may not be contained e076 value classes may not wrap another value class e077 value class parameter may not be a var e078 value class needs exactly one val parameter e079 only case class or case object allowed e080 expected top level def e081 anonymous function missing parameter type e082 super calls not allowed in inlineable e083 not a path e084 wildcard on type argument not allowed on new e085 function type needs non empty parameter list e086 wrong number of parameters e087 duplicate private protected qualifier e088 expected start of top level definition e089 missing return type with return statement e090 no return from inlineable e091 return outside method definition e092 unchecked type pattern e093 extend final class e094 enum case definition in non enum owner e095 expected type bound or equals e096 class and companion name clash e097 tailrec not applicable e098 failure to eliminate existential e099 only functions can be followed by underscore e100 missing empty argument list e101 duplicate named type parameter e102 undefined named type parameter e103 illegal start of statement e104 trait is expected e105 trait redefined final method from anyref e106 package name already defined e107 unapply invalid number of arguments e108 unapply invalid return type e109 static fields only allowed in objects e110 cyclic inheritance e111 bad symbolic reference e112 unable to extend sealed class e113 symbol has unparsable version number e114 symbol changed semantics in version e115 unable to emit switch e116 missing companion for static e117 polymorphic method missing type in parent e118 params no inline e119 symbol is not a value e120 double definition e121 match case only null warning e122 imported twice e123 type test always diverges e124 term member needs result type for implicit search e125 class cannot extend enum e126 value class parameter may not be call by name e127 not an extractor e128 member with same name as static e129 pure expression in statement position e130 trait companion with mutable static e131 lazy static field e132 static overriding non static members e133 overload in refinement e134 no matching overload e135 stable identifier pattern e136 static fields should precede non static e137 illegal super accessor e138 trait parameter used as parent prefix e139 unknown named enclosing class or object e140 illegal cyclic type reference e141 missing type parameter in type app e142 skolem in inferred e143 erased types can only be function types e144 case class missing non implicit parameter list e145 enumerations should not be empty e146 illegal parameter initialization e147 redundant modifier e148 typed case does not explicitly extend typed enum e149 illegal redefinition of standard kind e150 no extension method allowed e151 extension method cannot have type parameters e152 extension can only have defs e153 unexpected pattern for summonfrom e154 anonymous instance cannot be empty e155 type splice in val pattern e156 modifier not allowed for definition e157 cannot extend java enum e158 invalid reference in implicitnotfound annotation e159 trait may not define native method e160 java enum parent args e161 already defined e162 case class in inlined code e163 override type mismatch error e164 override error e165 matchable warning e166 cannot extend function e167 lossy widening constant conversion e168 implicit search too large e169 targetname on top level class e170 not class type e171 missing argument e172 missing implicit argument e173 cannot be accessed e174 inline given should not be function e175 value discarding e176 unused non unit value e177 constructor proxy shadows e178 missing argument list e179 match type scrutinee cannot be higher kinded e180 ambiguous extension method e181 unqualified call to anyref method e182 not constant e183 closure cannot have internal parameter dependencies e184 match type no cases e185 unimported and imported e186 implausible pattern warning e187 synchronized call on boxed class e188 varargs param cannot be given e189 extractor not found e190 pure unit expression e191 match type legacy pattern e192 unstable inline accessor e193 volatile on val e194 extension nullified by member e195 phantom symbol not value e196 context bound companion not value e197 inlined anonymous class warning e198 unused symbol e199 tailrec nested call e200 final local def e201 non named argument in java annotation e202 quoted type missing e203 deprecated assignment syntax e204 deprecated infix named argument syntax e205 given search priority warning e206 enum may not be value class e207 illegal unroll placement e208 extension has default receiver e209 format interpolation error e210 value class cannot extend alias of anyval e211 match is not partial function e212 only fully dependent applied constructor type e213 pointless applied constructor type e214 illegal context bounds e215 named pattern not applicable e216 unnecessary nn e217 erased not pure e218 illegal erased definition e219 cannot instantiate quoted type variable e220 default shadows given e221 recurse with default e222 encoded package name e223 cannot be included in capture set e224 override class e225 infer union warning e226 type parameter shadows type e227 private shadows type generated with copyright c 2002 2026 lamp epfl copyright c 2002 2026 lamp epfl scala 3 reference edit this page on github scala 3 reference scala 3 implements many language changes and improvements over scala 2 in this reference we discuss design decisions and present important differences compared to scala 2 goals the language redesign was guided by three main goals strengthen scala s foundations make the full programming language compatible with the foundational work on the dot calculus and apply the lessons learned from that work make scala easier and safer to use tame powerful constructs such as implicits to provide a gentler learning curve remove warts and puzzlers further improve the consistency and expressiveness of scala s language constructs corresponding to these goals the language changes fall into seven categories 1 core constructs to strengthen foundations 2 simplifications and 3 restrictions to make the language easier and safer to use 4 dropped constructs to make the language smaller and more regular 5 changed constructs to remove warts and increase consistency and usability 6 new constructs to fill gaps and increase expressiveness 7 a new principled approach to metaprogramming that replaces scala 2 experimental macros essential foundations these new constructs directly model core features of dot higher kinded types and the si calculus for implicit resolution intersection types replacing compound types union types type lambdas replacing encodings using structural types and type projection context functions offering abstraction over given parameters simplifications these constructs replace existing constructs with the aim of making the language safer and simpler to use and to promote uniformity in code style trait parameters replace early initializers with a more generally useful construct given instances replace implicit objects and defs focussing on intent over mechanism using clauses replace implicit parameters avoiding their ambiguities extension methods replace implicit classes with a clearer and simpler mechanism opaque type aliases replace most uses of value classes while guaranteeing the absence of boxing top level definitions replace package objects dropping syntactic boilerplate export clauses provide a simple and general way to express aggregation which can replace the previous facade pattern of package objects inheriting from classes vararg splices now use the form xs in function arguments and patterns instead of xs _ and xs _ universal apply methods allow using simple function call syntax instead of new expressions new expressions stay around as a fallback for the cases where creator applications cannot be used with the exception of early initializers and old style vararg patterns all superseded constructs continue to be available in scala 3 0 the plan is to deprecate and phase them out later 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 restrictions these constructs are restricted to make the language safer implicit conversions there is only one way to define implicit conversions instead of many and potentially surprising implicit conversions require a language import given imports implicits now require a special form of import to make the import clearly visible type projection only classes can be used as prefix c of a type projection c a type projection on abstract types is no longer supported since it is unsound multiversal equality implement an opt in scheme to rule out nonsensical comparisons with and infix make method application syntax uniform across code bases 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 source 3 0 migration dropped constructs 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 delayedinit existential types procedure syntax class shadowing xml literals symbol literals auto application weak conformance compound types replaced by intersection types auto tupling implemented but not merged the date when these constructs are dropped varies the current status is not implemented at all delayedinit existential types weak conformance supported under source 3 0 migration procedure syntax class shadowing symbol literals auto application auto tupling in a restricted form supported in 3 0 to be deprecated and phased out later xml literals compound types changes these constructs have undergone changes to make them more regular and useful structural types they now allow pluggable implementations which greatly increases their usefulness some usage patterns are restricted compared to the status quo name based pattern matching the existing undocumented scala 2 implementation has been codified in a slightly simplified form automatic eta expansion eta expansion is now performed universally also in the absence of an expected type the postfix _ operator is thus made redundant it will be deprecated and dropped after scala 3 0 implicit resolution 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 most aspects of old style implicit resolution are still available under source 3 0 migration the other changes in this list are applied unconditionally new constructs these are additions to the language that make it more powerful or pleasant to use enums provide concise syntax for enumerations and algebraic data types parameter untupling avoids having to use case for tupled parameter destructuring dependent function types generalize dependent methods to dependent function values and types polymorphic function types generalize polymorphic methods to polymorphic function values and types current status there is a proposal and a merged prototype implementation but the implementation has not been finalized it is notably missing type inference support kind polymorphism allows the definition of operators working equally on types and type constructors targetname annotations make it easier to interoperate with code written in other languages and give more flexibility for avoiding name clashes metaprogramming the following constructs together aim to put metaprogramming in scala ...
|