Ignored conditional unwrapping in Silver

IDE: Visual Studio 2017/Fire
Version: .2373
Target (If relevant): WPF/Android
Description:

This produces NullReferenceException, although it shouldn’t (and doesn’t in XCode). Test project attached.

public class SomeClass {

    private func doSomething() {

        let test = EventTest()
        test.onTest?(test)  //  NullReferenceException
    }
}

public class EventTest {
    public var onTest: EventTestDelegate?
}

public typealias EventTestDelegate = (aTest: EventTest) -> ()

TestNullableEvent.zip (306.5 KB)

Interesting, this only happens with delegates i.e. typealias SomeDelegate = (String) -> (), it doesn’t happen with regular variables.

Thanks, logged as bugs://82143

bugs://82143 got closed with status fixed.