Skip to content

Rule request: Warn when second dot on numeric literal causes member access expression #1698

@iRon7

Description

@iRon7

Summary of the new feature

See: #15756 Unquoted numbers with two or more dots should cast to a [version] rather than $Null
When an unquoted number contains two or more dots, the second dot is seen as a member separator (rather than an illegal addition decimal separator) which causes the syntax unexpectedly to return $Null without notice:

$Version = 2.0.9
$Null -eq $Version
True

What is the latest version of PSScriptAnalyzer at the point of writing
1.19.1

Metadata

Metadata

Assignees

No one assigned

    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