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

Support a way to reason about a field's type from the record/class type #26444

Open
bradcray opened this issue Dec 20, 2024 · 2 comments
Open

Comments

@bradcray
Copy link
Member

bradcray commented Dec 20, 2024

This issue requests ways to reason about the type of a record type's field, such as:

record myRecordType {
  var myField: int;
}

…myRecordType.myField.type

Note that this is somewhat related to issue #11816 (which is similar, but more general) and #12167 which is attractive due to the ability to get a field's type without knowing its name.

@DanilaFe
Copy link
Contributor

DanilaFe commented Jan 2, 2025

I was a little confused at first, but I think you're requesting the following:

record R {
  var x: int;
}
type t = R.x.type;

Initially, I interpreted your request as:

record R {
  var x: int;
}
var myRecord: R;
type t = myRecord.x.type;

Which already works today.

Just commenting this for anyone else who might get confused like I did.

@bradcray bradcray changed the title Support a way to reason about a field's type Support a way to reason about a field's type from the record/class type Jan 6, 2025
@bradcray
Copy link
Member Author

bradcray commented Jan 6, 2025

Good point Daniel—I've updated the title and OP to try and clarify this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants