Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Refactor DataFlow::FunctionNode as a concrete class #362

Merged
merged 1 commit into from
Oct 6, 2020

Conversation

smowton
Copy link
Contributor

@smowton smowton commented Oct 1, 2020

This makes it easier to refine FunctionNode without having to define abstract members.

@@ -216,10 +216,24 @@ class SsaNode extends Node, MkSsaNode {
}
}

abstract private class FunctionNodeRange extends Node {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be something like

Suggested change
abstract private class FunctionNodeRange extends Node {
module FunctionNode {
abstract private class Range extends Node {

Copy link
Contributor Author

@smowton smowton Oct 1, 2020

Choose a reason for hiding this comment

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

I figured there was no point when we don't actually want to expose the range for others to extend. We were using that module technique to fake namespaces / nested classes, but here we never want to address it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'd prefer for it to be consistent, unless there's some reason it shouldn't be.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, turns out such a thing isn't accessible because it's a private entity inside a module. I either have to define FunctionNode inside the same module, or make the class public and write a bunch of redundant documentation or upset the docubot. That being so, I've left its name alone

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, right. Can you just make the module private instead of the class to preserve semantics?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, but then the class is public and has to be documented despite being unusable?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, but that's the same as most of the internal data-flow stuff anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

k, done

@smowton smowton force-pushed the smowton/admin/refactor-function-node branch 2 times, most recently from 9d14780 to a74bf0a Compare October 5, 2020 10:57
This makes it easier to refine FunctionNode without having to define abstract members.
@smowton smowton force-pushed the smowton/admin/refactor-function-node branch from a74bf0a to 68bb7b0 Compare October 6, 2020 13:03
@smowton
Copy link
Contributor Author

smowton commented Oct 6, 2020

@sauyon is this ok to merge by you?

Copy link
Contributor

@sauyon sauyon left a comment

Choose a reason for hiding this comment

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

👍 yep

@smowton smowton merged commit d7dcf27 into github:main Oct 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants