关于Dart2那些事儿-关键字

2019-12-06  本文已影响0人  WizardL

这里列出了Dart中的所有关键词
abstract (1)
do
import (1)
super
as (1)
dynamic (1)
in
switch
assert
else
interface (1)
sync* (2)
async (2)
enum
is
this
async* (2)
export (1)
library (1)
throw
await (2)
external (1)
mixin (1)
true
break
extends
new
try
case
factory (1)
null
typedef (1)
catch
false
operator (1)
var
class
final
part (1)
void
const
finally
rethrow
while
continue
for
return
with
covariant (1)
get (1)
set (1)
yield (2)
default
if
static (1)
yield*
deferred (1)
implements (1)

(1)带有上标1的单词是内置标识符。避免使用内置标识符作为标识符。如果尝试为类或类型名使用内置标识符,则会发生编译时错误。
(2)使用上标2的单词是在Dart的1.0版本之后添加的与异步支持相关的更新的、有限的保留字。在以async, async, 或者 sync 标记的任何函数体中,不能使用async, await, 或者 yield作为标识符。有关更多信息,请参见异步支持。
关键字表中的所有其他词都是保留词。不能使用保留词作为标识符。

上一篇 下一篇

猜你喜欢

热点阅读