Skip to content

Remove extra well-known members from Range#32805

Merged
agocke merged 9 commits into
dotnet:dev16.0from
agocke:range-well-known
Feb 15, 2019
Merged

Remove extra well-known members from Range#32805
agocke merged 9 commits into
dotnet:dev16.0from
agocke:range-well-known

Conversation

@agocke

@agocke agocke commented Jan 25, 2019

Copy link
Copy Markdown
Member

We currently require more members than strictly necessary for range
syntax. This change makes it so we only require one member. It may be
useful for performance to use extra members in the future, but right
now optimal range performance is not what we're focusing on and this
allows CoreFX to change the names without require a compiler change.

@agocke agocke requested review from a team and jaredpar January 25, 2019 22:51
@jcouv jcouv added the Feature - Range Range label Jan 25, 2019

@jcouv jcouv Jan 29, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps factor this block out: left = optimizeOrCreateIndex(left, fromEnd: false);? Possibly could be factored into a single local function (ie. merge the logic with tryOptimizeOperand).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

""System.Range System.Range.FromStart(System.Index)"" [](start = 23, length = 53)

Is there a design/speclet document that should be updated to reflect the compiler/API design?
It may be good to send an email to LDM (and relevant BCL folks) to let them know of this change and rationale.

jcouv
jcouv previously approved these changes Jan 29, 2019

@jcouv jcouv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks (iteration 5)

@jcouv jcouv self-assigned this Jan 29, 2019
@agocke

agocke commented Feb 14, 2019

Copy link
Copy Markdown
Member Author

Updated PR to use the new API from CoreFX. The well-known members are described in dotnet/csharplang#2214, although this PR doesn't use any of the optional members.

@agocke agocke closed this Feb 14, 2019
@agocke agocke reopened this Feb 14, 2019
@agocke agocke closed this Feb 14, 2019
@agocke agocke reopened this Feb 14, 2019
@jcouv jcouv dismissed their stale review February 14, 2019 23:31

Scope/design changed

@jcouv jcouv added this to the 16.0.P4 milestone Feb 14, 2019
@jcouv

jcouv commented Feb 14, 2019

Copy link
Copy Markdown
Contributor

Note: you'll want to re-target to dev16.0 branch for preview4 or GA.

@agocke

agocke commented Feb 14, 2019

Copy link
Copy Markdown
Member Author

@jcouv Good point, thanks.

We previously required more members than strictly necessary for range
syntax. This change makes it so we only require one member. It may be
useful for performance to use those members in the future, but right
now optimal range performance is not what we're focusing on.
@agocke agocke changed the base branch from master to dev16.0 February 15, 2019 00:00
@@ -121,12 +134,11 @@ private BoundExpression LiftRangeExpression(BoundRangeExpression node, Immutable
Debug.Assert(condition != null);

// method(left.GetValueOrDefault(), right.GetValueOrDefault())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method [](start = 15, length = 6)

nit: comment seems out-of-date.
Also, name of the local (rangeCall) should probably be rangeCreation

Comment thread src/Compilers/CSharp/Test/Emit/CodeGen/IndexAndRangeTests.cs
{
public readonly struct Index
using System.Runtime.CompilerServices;
public readonly struct Index : IEquatable<Index>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Index [](start = 27, length = 5)

I assume this is copied from corefx, so doesn't need reviewing. Let me know if otherwise.

@jcouv jcouv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks (iteration 9)

@agocke agocke merged commit 1f44fbf into dotnet:dev16.0 Feb 15, 2019
@agocke agocke deleted the range-well-known branch February 15, 2019 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants