Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update records-wip.md #3353

Merged
merged 8 commits into from
Apr 30, 2020
Merged

Update records-wip.md #3353

merged 8 commits into from
Apr 30, 2020

Conversation

agocke
Copy link
Member

@agocke agocke commented Apr 10, 2020

Relates to dotnet/roslyn#40726 (test plan for records)

@gafter
Copy link
Member

gafter commented Apr 10, 2020

A valid with expression has a receiver with a non-void type. The receiver type must contain an accessible parameterless instance method called Clone whose return type must be the type of the receiver express type, or a base type thereof.

I have no idea what this means. #Closed


Refers to: proposals/records-wip.md:92 in e67167a. [](commit_id = e67167a, deletion_comment = False)

@gafter
Copy link
Member

gafter commented Apr 10, 2020

sequence of assignments with a compiler-generated record property of the receiver on the left-hand side of the

I don't know what this means.


Refers to: proposals/records-wip.md:95 in e67167a. [](commit_id = e67167a, deletion_comment = False)

proposals/records-wip.md Outdated Show resolved Hide resolved
proposals/records-wip.md Outdated Show resolved Hide resolved
@gafter
Copy link
Member

gafter commented Apr 10, 2020

A valid with expression has a receiver with a non-void type. The receiver type must contain an accessible parameterless instance method called Clone whose return type must be the type of the receiver express type, or a base type thereof.

Record types, as defined herein, do not typically contain such a Clone method, so this section doesn't make sense in the context of this spec. #Closed


Refers to: proposals/records-wip.md:92 in e67167a. [](commit_id = e67167a, deletion_comment = False)

@agocke
Copy link
Member Author

agocke commented Apr 10, 2020

I modified the phrasing to clarify that the return type of a Clone method must be the receiver type or a base type.

@agocke
Copy link
Member Author

agocke commented Apr 10, 2020

Record types, as defined herein, do not typically contain such a Clone method, so this section doesn't make sense in the context of this spec.

Seems well-defined to me. Records may implicitly define a Clone method in a future revision of the spec, but I haven't gotten there yet.

proposals/records-wip.md Outdated Show resolved Hide resolved
@gafter
Copy link
Member

gafter commented Apr 10, 2020

sequence of assignments with a compiler-generated record property of the receiver on the left-hand side of the

I think you need to identify the lookup rules and the error cases.


In reply to: 612224166 [](ancestors = 612224166)


Refers to: proposals/records-wip.md:95 in e67167a. [](commit_id = e67167a, deletion_comment = False)

proposals/records-wip.md Outdated Show resolved Hide resolved
@gafter
Copy link
Member

gafter commented Apr 10, 2020

I'm having a hard time making sense of the overall specification with just the pieces you're revealing. I understand you're only implementing some pieces, but without the missing pieces of the spec... the things that are in the spec you're providing don't fit together.

@agocke
Copy link
Member Author

agocke commented Apr 10, 2020

Yup, I'll try to clarify this a bit more. It may be better to just write this using "init-only" terminology and then note the implementation gaps in the PR.

@agocke
Copy link
Member Author

agocke commented Apr 10, 2020

Added some notes about initonly without going into too much detail.

I'm not clear what you mean by comments on the lookup rules. The lookup for Clone() is just straightforward method lookup, and the property lookup is equivalent to lookup for a property get

@gafter
Copy link
Member

gafter commented Apr 10, 2020

We don't have a "lookup for a property get". We just do a simple name lookup (or qualified name lookup).

proposals/records-wip.md Show resolved Hide resolved
proposals/records-wip.md Show resolved Hide resolved
proposals/records-wip.md Show resolved Hide resolved
@agocke agocke merged commit c300394 into master Apr 30, 2020
@agocke agocke deleted the with-expression branch April 30, 2020 17:28
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.

3 participants