Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support null-conditional operator when the return value is a pointer type #7502

@redknightlois

Description

@redknightlois
public class A
{
    public byte* Ptr;
}

The following code will not compile.

var x = new A ();
byte* ptr = x?.Ptr;

The error itself doesnt make a lot of sense, so my guess it could be a potential bug:

Error CS0023 -- Operator '?' cannot be applied to operand of type 'byte*'

If not it is a quite handy operator to deal with pointers.

Metadata

Metadata

Assignees

Labels

Area-CompilersBugConcept-Diagnostic ClarityThe issues deals with the ease of understanding of errors and warnings.help wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions