在 ActionScript 3 中,当您通过为其指定默认值来声明可选参数时,值null不能用于类型化参数。
function Action(Param:int=null){
// 1184: Incompatible default value of type Null where int is expected.
}
function Action(Param:int=0){
// No compiler errors
}
任何解决方法,或可应用于所有数据类型的通用值?