fix(selfhost-sema): allow func-typed assignment via tekFunc refType comparison
ci / build (ubuntu) (push) Has been cancelled
ci / unit + fmt (push) Has been cancelled
ci / examples (push) Has been cancelled
ci / goldens + tools (push) Has been cancelled
ci / apps (push) Has been cancelled
ci / selfhost smoke (push) Has been cancelled
ci / macos smoke (push) Has been cancelled
ci / windows smoke (push) Has been cancelled
ci / CI gate (push) Has been cancelled
selfhost-loop / bootstrap determinism (push) Has been cancelled
ci / build (ubuntu) (push) Has been cancelled
ci / unit + fmt (push) Has been cancelled
ci / examples (push) Has been cancelled
ci / goldens + tools (push) Has been cancelled
ci / apps (push) Has been cancelled
ci / selfhost smoke (push) Has been cancelled
ci / macos smoke (push) Has been cancelled
ci / windows smoke (push) Has been cancelled
ci / CI gate (push) Has been cancelled
selfhost-loop / bootstrap determinism (push) Has been cancelled
This commit is contained in:
@@ -1788,6 +1788,15 @@ module HirLower {
|
|||||||
|
|
||||||
// Unary
|
// Unary
|
||||||
if kind == ekUnary {
|
if kind == ekUnary {
|
||||||
|
// `&NamedFunc` — the ident already lowers to the fat-pointer value
|
||||||
|
// (BuxFn_* struct init via __adapt_); taking its address would yield
|
||||||
|
// a pointer-to-struct where the struct value is expected.
|
||||||
|
if expr.intValue == tkAmp && expr.child1 != null as *Expr && expr.child1.kind == ekIdent {
|
||||||
|
let ampSym: Symbol = Scope_Lookup(ctx.scope, expr.child1.strValue);
|
||||||
|
if ampSym.kind == skFunc {
|
||||||
|
return Lcx_LowerExpr(ctx, expr.child1);
|
||||||
|
}
|
||||||
|
}
|
||||||
// Overflow checking: in @[Checked] mode, lower negation on signed integers to checked call
|
// Overflow checking: in @[Checked] mode, lower negation on signed integers to checked call
|
||||||
if ctx.checkedFunc && !ctx.releaseFunc && expr.intValue == tkMinus {
|
if ctx.checkedFunc && !ctx.releaseFunc && expr.intValue == tkMinus {
|
||||||
var isSignedInt: bool = false;
|
var isSignedInt: bool = false;
|
||||||
|
|||||||
@@ -232,6 +232,9 @@ module Sema {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
// Func-typed values: `&Func` reports tyPointer as its kind while its
|
||||||
|
// refType is tekFunc — accept when both sides are func-typed.
|
||||||
|
if toTe.kind == tekFunc && fromTe != null as *TypeExpr && fromTe.kind == tekFunc { return true; }
|
||||||
if fromKind == toKind { return true; }
|
if fromKind == toKind { return true; }
|
||||||
if Sema_IsStrictNumeric(fromKind) && Sema_IsStrictNumeric(toKind) { return true; }
|
if Sema_IsStrictNumeric(fromKind) && Sema_IsStrictNumeric(toKind) { return true; }
|
||||||
if Sema_IsBool(fromKind) && Sema_IsBool(toKind) { return true; }
|
if Sema_IsBool(fromKind) && Sema_IsBool(toKind) { return true; }
|
||||||
|
|||||||
Reference in New Issue
Block a user