조건부 삼항 연산자를 통해 Nothing (Of Double)으로 설정할 수없는 이유는 무엇입니까?조건부 삼항 연산자에서 Nullable (Of)이 Nothing으로 설정되지 않음
Dim d As Double? = Nothing
d = If(True, 0, Nothing) ' result: d = 0
d = Nothing ' result: d = Nothing
d = If(False, 0, Nothing) ' result: d = 0 Why?
편집 : (아래 허용 대답에 따라)이 작업 :
d = If(False, 0, New Integer?)
d = If(False, CType(0, Double?), Nothing)
d = If(False, 0, CType(Nothing, Double?))
http://stackoverflow.com/a/ 1828205/1070452 – Plutonix
'Option Strict On'은 이런 상황에서 훨씬 더 빨리 피드백을 줄 것이다. – Fabio