Targets · Dart · Reserved words

Reserved words

Dart keeps a set of words for its own syntax, so a program cannot use them as names. When a Program name collides with one, the renderer appends a single underscore — class becomes class_ — so the program keeps the name it chose and the output still compiles. Because _ is illegal in a Program identifier, the escape can never collide with a name a program actually chose.

Contents

How a Program becomes Dart, in parts. Start with the introduction, then follow each part into the rendered output and the runtime it links against.

The full list

Every word Dart reserves, with the identifier a colliding Program name is escaped to. The rule is uniform — append a single _:

Reserved wordRendered identifier
abstractabstract_
asas_
assertassert_
asyncasync_
awaitawait_
breakbreak_
casecase_
catchcatch_
classclass_
constconst_
continuecontinue_
covariantcovariant_
defaultdefault_
deferreddeferred_
dodo_
dynamicdynamic_
elseelse_
enumenum_
exportexport_
extendsextends_
extensionextension_
externalexternal_
factoryfactory_
falsefalse_
finalfinal_
finallyfinally_
forfor_
functionfunction_
getget_
hidehide_
ifif_
implementsimplements_
importimport_
inin_
interfaceinterface_
isis_
latelate_
librarylibrary_
mixinmixin_
newnew_
nullnull_
onon_
operatoroperator_
partpart_
requiredrequired_
rethrowrethrow_
returnreturn_
sealedsealed_
setset_
showshow_
staticstatic_
supersuper_
switchswitch_
syncsync_
thisthis_
throwthrow_
truetrue_
trytry_
typedeftypedef_
varvar_
voidvoid_
whilewhile_
withwith_
yieldyield_