Skip to content

Compiler crash when attempting to define extension inside interface type #78222

@DaZombieKiller

Description

@DaZombieKiller

Version Used:
4.14.0-3.25179.1 (304768b)

Steps to Reproduce:

Attempt to compile the following code:

interface IInterface
{
    extension(object)
    {
    }
}

Expected Behavior:
CS9283: Extensions must be declared in a top-level, non-generic, static class

Actual Behavior:
Process terminated. System.InvalidOperationException: Unexpected value 'Extension' of type 'Microsoft.CodeAnalysis.TypeKind'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions