You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiling a rustler project using the latest elixir 1.18-rc.0
generates the following compile warning at the use Rustler injection site
warning: the following clause will never match:
{^default_load_data_value, {module, function}}
because it attempts to match on the result of:
{0, nil}
which has type:
{integer(), nil}
where "default_load_data_value" (context Rustler) was given the type:
# type: integer()
# from: lib/rustler_mix_test.ex:1
default_load_data_value = 0
typing violation found at:
│
1 │ defmodule RustlerMixTest do
│ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
│
└─ lib/rustler_mix_test.ex:1: RustlerMixTest._construct_load_data/0
The warning originates at this pattern match
presumably because the compiler infers the types of load_data and load_data_fun based on the default values set in struct definition? 🤔
I'm not sure if it's a false positive in the 1.18 compiler so I opened an issue here first for confirmation 🙇
The text was updated successfully, but these errors were encountered:
I looked a bit into this. I think the issue is that we generate a macro within __before_compile__ which then uses case expressions in its body where the values to match are completely static. I'll rewrite this section to "run" the case directly in __before_compile__ instead.
Compiling a rustler project using the latest elixir 1.18-rc.0
generates the following compile warning at the
use Rustler
injection siteThe warning originates at this pattern match
presumably because the compiler infers the types of
load_data
andload_data_fun
based on the default values set in struct definition? 🤔I'm not sure if it's a false positive in the 1.18 compiler so I opened an issue here first for confirmation 🙇
The text was updated successfully, but these errors were encountered: