autofix-type-conversion
Fixes type mismatch errors by adding appropriate casts or conversions.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Fixes type mismatch errors by adding appropriate casts or conversions.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Comprehensive build error repair tool for C++, Rust, and Java projects using Soong, GN, Make, or CMake. Automatically fixes 30+ types of errors including headers, linking, APIs, and config.
Fixes function call errors with wrong number or type of arguments.
Fixes syntax errors in Android.bp files.
Removes unsupported or unknown compiler flags from build configurations.
Fixes scope and variable errors in BUILD.gn files.
Fixes script permission errors by making files executable.
| name | autofix-type-conversion |
| description | Fixes type mismatch errors by adding appropriate casts or conversions. |
Fixes compilation errors related to incompatible type assignments or conversions.
cannot convert 'X' to 'Y'invalid conversion from 'X' to 'Y'no viable conversionincompatible typesExtract:
| From | To | Fix |
|---|---|---|
std::string | const char* | .c_str() |
const char* | std::string | Constructor or assignment |
int | enum | static_cast<EnumType>(val) |
void* | T* | static_cast<T*>(ptr) |
Base* | Derived* | dynamic_cast<Derived*>(base) |
int64_t | int | static_cast<int>(val) (with care) |
Example: string to const char*
// Before (error)
void log(const char* msg);
std::string message = "Hello";
log(message); // ERROR
// After
log(message.c_str());
Example: enum cast
// Before
int value = 5;
MyEnum e = value; // ERROR
// After
MyEnum e = static_cast<MyEnum>(value);
Ensure semantic correctness, not just compilation success.