#nullable enable
using System;
public interface IBase {
}
public class Z : IBase {
public interface IX {
public class X : IX, IBase {
public class Program
{
public static void Main()
TestIsNot(null);
TestIsNot(new Z());
TestIsNot(new X());
public static void TestIsNot(object? obj){
if (obj is not IX notX){
System.Console.Out.WriteLine($"Not x but not null? {notX is not null}");