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

Refactor type element #70

Closed

Conversation

PaulSandoz
Copy link
Member

@PaulSandoz PaulSandoz commented May 1, 2024

Rename TypeElement to CodeType, thereby avoiding confusion with javax.lang.model.element.TypeElement (CodeType is closer to javax.lang.model.type.TypeMirror and java.lang.reflect.Type).

Rename TypeDefintion to ExternalizedCodeType and enclose within CodeType.

It's possible to go further and define a subtype ExternalizableCodeType that supports externalization to ExternalizedCodeType, copying the pattern for operations. This requires some adjustments to the externalization of types that may be composed of other posssibly non-externalizable types e.g. FunctionType. We can consider this separately to this PR.


Progress

  • Change must not contain extraneous whitespace

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/babylon.git pull/70/head:pull/70
$ git checkout pull/70

Update a local copy of the PR:
$ git checkout pull/70
$ git pull https://git.openjdk.org/babylon.git pull/70/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 70

View PR using the GUI difftool:
$ git pr show -t 70

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/babylon/pull/70.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 1, 2024

👋 Welcome back psandoz! A progress list of the required criteria for merging this PR into code-reflection will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented May 1, 2024

@PaulSandoz This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

Refactor type element

Reviewed-by: mcimadamore

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been no new commits pushed to the code-reflection branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the code-reflection branch, type /integrate in a new comment.

@openjdk openjdk bot added ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 1, 2024
@mlbridge
Copy link

mlbridge bot commented May 1, 2024

Webrevs

@mcimadamore
Copy link
Collaborator

Have you considered the name OpType? Since the code model API is mainly about "ops" and types are meta-data attached to such ops, the name seems a bit less general than "code type".

@mcimadamore
Copy link
Collaborator

mcimadamore commented May 2, 2024

It's possible to go further and define a subtype ExternalizableCodeType that supports externalization to ExternalizedCodeType, copying the pattern for operations.

Yeah. that would seem more consistent with what with did with Ops. Also I note there's an externalize method that throws UOE on non-externalizable types which seems to call for pattern match. (But that can some i a separate PR)

@PaulSandoz
Copy link
Member Author

Have you considered the name OpType? Since the code model API is mainly about "ops" and types are meta-data attached to such ops, the name seems a bit less general than "code type".

(Code) Types are associated with results of operations and parameters of blocks. I did ponder ValueType, WDYT?
I was concerned with any misleading association with Valhalla, but that's likely silly since we already have Value.

@PaulSandoz
Copy link
Member Author

On further reflection i will close this issue without integrating. It seems unnecessary churn right now. I will create another PR that focuses on the less disruptive refactor of TypeDefinition to ExternalizedTypeElement.

@PaulSandoz PaulSandoz closed this May 2, 2024
@PaulSandoz PaulSandoz deleted the refactor-type-element branch June 21, 2024 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Pull request is ready to be integrated rfr Pull request is ready for review
2 participants