autofix-type-conversion
Fixes type mismatch errors by adding appropriate casts or conversions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Fixes type mismatch errors by adding appropriate casts or conversions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 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.