microsoft / microsoft/powerquery-parser

[BUG] - Recursive Section Member Reference Isn't Accepted as Valid

Open
#340 4 comments 0 reactions 1 assignee View on GitHub

@JordanBoltonMN is already working on this.

Since Aug 12, 2022.

bug
Dominant language
TypeScript
Stars
137
Forks
34
Avg merge
50m
Merged PRs (30d)
1

Description

Expected behavior
The M language specification and the existing Power Query SDK allow a section member to use an exclusive identifier reference to refer to itself (e.g. the SumConsecutive(x - 1) reference in the below example).

section SomeSection;

SumConsecutive = (x) => if x <= 0 then 0 else x + SumConsecutive(x - 1);

Actual behavior
The parser considers the above-mentioned reference an error, complaining that it "cannot find the name 'SumConsecutive'".
image

To Reproduce
In VSCode, create a new Power Query document. Paste in the above M code. The error shown in the screenshot will then be displayed.

Additional context
Power Query / M Language extension version: v0.1.42

Thank you for your help with this, and for the VSCode extension!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.