Skip to content

Handle property declarations #2

Description

@Hookyns

Feature request

What is the usage?

class Foo 
{
    private static expression: Expression<(x: any) => boolean> = x => !!x;
}

What is the expected behavior?
Field expression is handled and processed by the transformer. So Expression object will be assigned to expression field.

What is motivation or use case for adding/changing the behavior?
To keep behavior as close as possible to the C#.

How should this be implemented in your opinion?

else if (ts.isPropertyDeclaration(parent) && parent.initializer == node && (
    (parent.type && isExpressionTypeNode(parent.type, checker))
    || isExpressionType(checker.getTypeAtLocation(node))
))
{
    ....
}

This check is already prepared in main branch.

Are you willing to work on this yourself?
Doesn't matter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions