Skip to content

hir: reject nested storage map fields#1495

Open
g-r-a-n-t wants to merge 1 commit into
argotorg:masterfrom
g-r-a-n-t:storage-map-nested-diagnostic
Open

hir: reject nested storage map fields#1495
g-r-a-n-t wants to merge 1 commit into
argotorg:masterfrom
g-r-a-n-t:storage-map-nested-diagnostic

Conversation

@g-r-a-n-t

@g-r-a-n-t g-r-a-n-t commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e937f2ebff

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/hir/src/core/semantic/mod.rs Outdated
@cburgdorf

Copy link
Copy Markdown
Collaborator

This doesn't feel right to me. Why should the hir even know about StorageMap. Shouldn't this be caught by a bound on V already? It should be impossible to instantiate a StorageMap where V does not satisfy the WordRepr trait.

impl<K: StorageKey, V: WordRepr, const SALT: u256> StorageMap<K, V, SALT>

But maybe what we should do instead is moving the bound from the impl to the struct:

pub struct StorageMap<K: StorageKey, V: WordRepr, const SALT: u256 = _> {}

I believe that would then create a compile error one level earlier when a user attempts to declare an invalid StorageMap rather than at the time they try to instantiate it.

What does @sbillig think?

@g-r-a-n-t g-r-a-n-t marked this pull request as draft June 25, 2026 15:40
@g-r-a-n-t g-r-a-n-t marked this pull request as ready for review July 1, 2026 23:31

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 61a302fb88

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ingots/std/src/evm/storage_map.fe
Comment thread crates/hir/src/analysis/ty/trait_resolution/proof_forest.rs
@g-r-a-n-t

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 89ae4a61ac

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@g-r-a-n-t g-r-a-n-t force-pushed the storage-map-nested-diagnostic branch from 89ae4a6 to 7af8156 Compare July 7, 2026 17:28
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.

2 participants