mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-05 18:24:06 +00:00
Fix #4229 for edge case os.Error/os.Errno legacy bodge
This commit is contained in:
@@ -3451,8 +3451,14 @@ gb_internal lbValue lb_build_expr_internal(lbProcedure *p, Ast *expr) {
|
||||
|
||||
switch (expr->kind) {
|
||||
case_ast_node(bl, BasicLit, expr);
|
||||
if (type != nullptr && type->Named.name == "Error") {
|
||||
Entity *e = type->Named.type_name;
|
||||
if (e->pkg && e->pkg->name == "os") {
|
||||
return lb_const_nil(p->module, type);
|
||||
}
|
||||
}
|
||||
TokenPos pos = bl->token.pos;
|
||||
GB_PANIC("Non-constant basic literal %s - %.*s", token_pos_to_string(pos), LIT(token_strings[bl->token.kind]));
|
||||
GB_PANIC("Non-constant basic literal %s - %.*s (%s)", token_pos_to_string(pos), LIT(token_strings[bl->token.kind]), type_to_string(type));
|
||||
case_end;
|
||||
|
||||
case_ast_node(bd, BasicDirective, expr);
|
||||
|
||||
Reference in New Issue
Block a user