Skip to content

Assert fails in NullableWalker.AsMemberOfType #80255

@jjonescz

Description

@jjonescz

Version Used: 20250912.15 (d92fd99, main), Debug.

Steps to Reproduce:

.NET Lab

using System;

class C
{
    bool M(ReadOnlySpan<int> a, Span<int> b)
    {
        return b == a;
    }
}

(Target framework: net9.0)

This assert fails:

System.InvalidOperationException: Assertion failed
   at System.Diagnostics.Debug.Fail(String message, String detailMessage)
   at System.Diagnostics.Debug.Assert(Boolean condition)
   at Microsoft.CodeAnalysis.CSharp.NullableWalker.AsMemberOfType(TypeSymbol type, Symbol symbol)
   at Microsoft.CodeAnalysis.CSharp.NullableWalker.ReInferBinaryOperator(SyntaxNode syntax, MethodSymbol method, BoundExpression leftOperand, BoundExpression rightOperand, TypeWithState leftUnderlyingType, TypeWithState rightUnderlyingType)

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions