Cannot use optional chaining on non-optional value of type 'Double'

初学swift,有一段代码

 var labelValue:Double{
        get{
            return Double(show_result.text!)?? 0
        }
        set{
            show_result.text="\(newValue)"
        }
    }

总是报错“Cannot use optional chaining on non-optional value of type 'Double'”
百思不解,命名是按照示例敲的为什么会报错,原来swfit语法中有空格和没空差距很大,??
前有增加空格,变成

 var labelValue:Double{
        get{
            return Double(show_result.text!) ?? 0
        }
        set{
            show_result.text="\(newValue)"
        }
    }

你可能感兴趣的:(Cannot use optional chaining on non-optional value of type 'Double')