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

Rename .sty field on TyS #64353

Closed
varkor opened this issue Sep 10, 2019 · 5 comments · Fixed by #64513
Closed

Rename .sty field on TyS #64353

varkor opened this issue Sep 10, 2019 · 5 comments · Fixed by #64513
Assignees
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. I-needs-decision Issue: In need of a decision. S-waiting-on-bikeshed Status: Awaiting a decision on trivial things. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@varkor
Copy link
Member

varkor commented Sep 10, 2019

.kind makes more sense, but could be confusing, as it's not a type-theoretic kind. There's also the issue of having inconsistent ways to name a field containing a *Kind, e.g. .node and .kind. It would be good to make these consistent.

@varkor varkor added C-cleanup Category: PRs that clean code up or issues documenting cleanup. I-needs-decision Issue: In need of a decision. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 10, 2019
@varkor varkor self-assigned this Sep 10, 2019
@Centril
Copy link
Contributor

Centril commented Sep 10, 2019

I don't like ty.kind -- that's a bit of high-degree confusion in the heart of the type system.

I'd like to suggest a third alternative .form and ExprForm to use consistently everywhere.

@varkor
Copy link
Member Author

varkor commented Sep 10, 2019

@eddyb suggested .which.

@Centril
Copy link
Contributor

Centril commented Sep 10, 2019

I would like to have .thing and ExprThing be consistent. Idk if ExprWhich works so well here.

Another alternative: .shape: ExprShape.

@Centril Centril added the S-waiting-on-bikeshed Status: Awaiting a decision on trivial things. label Sep 10, 2019
@petrochenkov
Copy link
Contributor

I'm for FooKind / foo.kind, which is an existing and widely used convention.
TyKind / ty.kind is also ok.
The confusion with type-theoretic kinds applies only to a couple of selected cases, and even in case of ty.kind it's clear what kind it is, not worth changing conventions everywhere.

.node is a legacy convention, I always thought is didn't make much sense, personally, I'd gladly replace it with .kind in AST/HIR structures.

@oli-obk
Copy link
Contributor

oli-obk commented Sep 21, 2019

Alternative suggestion:

get rid of the fields on TyS and make the typeflags a query as well as the outer_exclusive_binder: DebruijnIndex something that is "computed" on the fly (most types are just innermost, but the few that aren't can have this info in their variant)

Centril added a commit to Centril/rust that referenced this issue Sep 26, 2019
Centril added a commit to Centril/rust that referenced this issue Sep 26, 2019
@bors bors closed this as completed in dc45735 Sep 26, 2019
flip1995 added a commit to flip1995/rust-clippy that referenced this issue Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. I-needs-decision Issue: In need of a decision. S-waiting-on-bikeshed Status: Awaiting a decision on trivial things. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants