Skip to content

effects: Improve is_mutation_free_type to also include immutable type…#48220

Merged
Keno merged 2 commits intomasterfrom
kf/ismutationfree
Jan 11, 2023
Merged

effects: Improve is_mutation_free_type to also include immutable type…#48220
Keno merged 2 commits intomasterfrom
kf/ismutationfree

Conversation

@Keno
Copy link
Copy Markdown
Member

@Keno Keno commented Jan 11, 2023

…s thereof

Addresses an outstanding todo. The property is memoized in the datatype like isbitstype. It is possible for types to refer to themselves via fields, so some form of memoization is required to avoid an infinite recursion.

@Keno
Copy link
Copy Markdown
Member Author

Keno commented Jan 11, 2023

Turns out the original change was insufficient and I had to do the same thing for is_consistent_type also, so I pushed that commit here also.

Copy link
Copy Markdown
Member

@aviatesk aviatesk left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Copy Markdown
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

SGTM

Keno added 2 commits January 11, 2023 04:48
…s thereof

Addresses an outstanding todo. The property is memoized in the datatype
like `isbitstype`. It is possible for types to refer to themselves
via fields, so some form of memoization is required to avoid an
infinite recursion.
I called the data type property `isidentityfree`, which I think
more accurately reflects what is being queried here.
@Keno Keno force-pushed the kf/ismutationfree branch from e9e79d6 to 318828c Compare January 11, 2023 04:49
@Keno Keno merged commit a526a4a into master Jan 11, 2023
@Keno Keno deleted the kf/ismutationfree branch January 11, 2023 15:23
aviatesk added a commit that referenced this pull request Jan 11, 2023
- set up the `isidentityfree` query as `ismutationfree` and refactor
  `is_consistent_type` a bit using it
- move the special handling of `Module`-type's `mutationfree` bit to
  `Core.Compiler` since it is entangled with the implementation detail
  within `Core.Compiler`
aviatesk added a commit that referenced this pull request Jan 11, 2023
- set up the `isidentityfree` query as `ismutationfree` and refactor
  `is_consistent_type` a bit using it
- move the special handling of `Module`-type's `mutationfree` bit to
  `Core.Compiler` since it is entangled with the implementation detail
  within `Core.Compiler`
aviatesk added a commit that referenced this pull request Jan 12, 2023
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