Skip to content

Handle constructor promotion with Nullable types #320

Closed
@yokozawa0701

Description

@yokozawa0701

I want to use Nullable types in a constructor promotion like following.

public function __construct(
    public ?string $name,
) {}

But it showed Unused function parameter $name. (VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable) .
Is it possible to use like this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions