W0059: Unavailable Type
Error
-module(main).
-spec foo() -> dep:nonexistent_type().
%% ^^^^^^^^^^^^^^^^^^^^^^ warning: W0059: Type 'dep:nonexistent_type/0' is not available through dependencies.
foo() -> ok.
Explanation
This diagnostic warns you when your code references a type that either:
- Does not exist (is undefined)
- Is not accessible because it's from a module outside your application's dependencies
- Exists but is not exported from the defining module
What This Diagnostic Checks
The diagnostic examines:
- Type specifications (
-specattributes) - Type definitions (
-typeand-opaqueattributes) - Callback specifications (
-callbackattributes)
How to Fix
- Check if the type actually exists
- Verify the name and arity of the type
- Add the application that defines the type to your application's dependencies or move the type definition to an application that is already a dependency