Skip to content

Skip (is_atom(name) or :fail) in is_struct/2 and is_exception/2 guard expansion when name is a compile-time atom - #15184

Closed
aptinio wants to merge 1 commit into
elixir-lang:mainfrom
allocator-one:fix/is-struct-guard-false-warning
Closed

Skip (is_atom(name) or :fail) in is_struct/2 and is_exception/2 guard expansion when name is a compile-time atom#15184
aptinio wants to merge 1 commit into
elixir-lang:mainfrom
allocator-one:fix/is-struct-guard-false-warning

Conversation

@aptinio

@aptinio aptinio commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Closes #15183

@josevalim

Copy link
Copy Markdown
Member

The type system is smart and i can see across function calls and variables too, so the correct fix here is to mark these particular constructs as quote generated: true do. I can push a fix soon!

@aptinio

aptinio commented Mar 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @josevalim! The type system is amazing! I've been trying it out on our large code base. Thanks for all your hard work.

@aptinio aptinio closed this Mar 12, 2026
@aptinio
aptinio deleted the fix/is-struct-guard-false-warning branch March 12, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

False warning: not is_struct(var, Module) in guard triggers incompatible types warning

2 participants