Skip to content

No Enum-Method-Interceptors are generated when invoked via C# 6 using static #26

@Flash0ver

Description

@Flash0ver

During testing of #9 via PR #10 we noticed that

using System;
using static System.Enum;

_ = GetName(DateTimeKind.Utc);
_ = IsDefined(DateTimeKind.Utc);

does not generate an Interceptor.

However, C# 12.0-style Interceptors do support static method invocations without qualifying the type name when a respective using static directive imports static members (and nested types).

Above user code should emit

[InterceptsLocation(@"..\Program.cs", 4, 5)]
internal static string? GetName(global::System.DateTimeKind value);

[InterceptsLocation(@"..\Program.cs", 5, 5)]
internal static bool IsDefined(global::System.DateTimeKind value)

Metadata

Metadata

Assignees

Labels

changelog:fixedSomething isn't working (SemVer:PATCH)scope:enumC# enumeration typestype:fixFix/patch a bug (this correlates with PATCH in Semantic Versioning)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions