Skip to content

Bug fix to allow RebuildShapeCombination for indexed static property gets#2512

Merged
KevinRansom merged 2 commits into
dotnet:masterfrom
alan-geller:indexed-static-properties
Mar 7, 2017
Merged

Bug fix to allow RebuildShapeCombination for indexed static property gets#2512
KevinRansom merged 2 commits into
dotnet:masterfrom
alan-geller:indexed-static-properties

Conversation

@alan-geller

Copy link
Copy Markdown
Contributor

The current implementation of RebuildShapeCombination fails if there are parameters passed to a StaticPropGetOp. The match pattern requires the arguments to be an empty list, even though the code for that match doesn't require this, and indeed mkStaticPropertyGet explicitly supports indexed properties and non-empty args lists.

All that is required is to replace the [] in the match with _, so that any list (whether empty or not) will match.

@msftclas

msftclas commented Mar 1, 2017

Copy link
Copy Markdown

@alan-geller,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@KevinRansom

Copy link
Copy Markdown
Contributor

@alan-geller could you add a regression test case so that we can keep this working?

Thanks

Kevin

@smoothdeveloper

smoothdeveloper commented Mar 2, 2017

Copy link
Copy Markdown
Contributor

would it make it easier to diagnostic issues in this code if

https://github.com/Microsoft/visualfsharp/pull/2512/files#diff-68af4b41d78e9577b6a461499c202298R2201

| _ -> raise <| System.InvalidOperationException (SR.GetString(SR.QillFormedAppOrLet))

was also printing %A of op,args?

@smoothdeveloper

Copy link
Copy Markdown
Contributor

Should we format that whole pattern match which is a bit difficult to comprehend due to misalignment?

@dsyme

dsyme commented Mar 2, 2017

Copy link
Copy Markdown
Contributor

The fix is correct, just needs the regression test

@alan-geller

Copy link
Copy Markdown
Contributor Author

I pushed a unit test. I think it's correct and in the right place, although it's a bit hard to be sure.

@KevinRansom

Copy link
Copy Markdown
Contributor

@alan-geller That's great, thanks, I will take care of the hand-waving to make sure the test is situated well.

Kevin

@alan-geller

Copy link
Copy Markdown
Contributor Author

Thanks, @KevinRansom !

@KevinRansom

Copy link
Copy Markdown
Contributor

@dotnet-bot test this please

@KevinRansom

Copy link
Copy Markdown
Contributor

Thank you for this

@KevinRansom KevinRansom merged commit fe2002b into dotnet:master Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants