Skip to content

Requires.NotNull should accept values of type T? #160

@9at8

Description

@9at8

https://dotnetfiddle.net/rB8FPD

In the following code, the Requires.NotNull call displays a warning

image

The Requires.NotNull function should accept values of type T? instead of T

#nullable enable

using System;
using Microsoft;
					
public class Program
{
	public static void Main()
	{
		Console.WriteLine("Hello World");
		
		Foo? str = null;

		Requires.NotNull(str, "");
	}
	
	private class Foo {
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions