Skip to content

Expression method bodies don't resolve const field references #250

@Jeroen-VdB

Description

@Jeroen-VdB

Proposal

When a const field is referenced inside an expression method body, the toolkit emits the field reference verbatim instead of its value.

Example

Constants:

static class MyConstants { public const string Issuer = "https://my-issuer.example.com"; }

Expression:

string GetIssuer(IExpressionContext context) => context.User.Id == MyConstants.Issuer ? "yes" : "no";

Current output:

@(context.User.Id == MyConstants.Issuer ? "yes" : "no")

Expected output:

@(context.User.Id == "https://my-issuer.example.com" ? "yes" : "no")

Component

Compiler

Contact Details

jeroen@innojero.com

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions