作者:n重庆商报程红Lft | 来源:互联网 | 2023-05-16 12:02
InActionScript3,whenyoudeclareanoptionalargumentbygivingitadefaultvalue,thevaluenul
In ActionScript 3, when you declare an optional argument by giving it a default value, the value null cannot be used on typed arguments.
在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
}
Any workarounds for this, or general purpose values that can apply to all data types?
此变通方法或可应用于所有数据类型的通用值的任何变通方法?
3 个解决方案