diff options
| author | 2022-08-04 07:39:23 +0200 | |
|---|---|---|
| committer | 2022-08-04 07:39:23 +0200 | |
| commit | bb1d4b4a3e51a06fb0530dfc271a97a6cd88cc73 (patch) | |
| tree | f300325814bc30e64f858ee313b8260a14d8df90 /bootstrap/env.c | |
| parent | 1625c50f0c0e4b1c7ba01a5df5713efaf6dce606 (diff) | |
stuff
Diffstat (limited to 'bootstrap/env.c')
| -rw-r--r-- | bootstrap/env.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bootstrap/env.c b/bootstrap/env.c index 513b4d9..0c0021b 100644 --- a/bootstrap/env.c +++ b/bootstrap/env.c @@ -14,14 +14,16 @@ envfind(const struct env *env, const char *name) { static bool declsshadowable(const struct decl *a, const struct decl *b) { - return b->t == Dvar; + return b->t == Dlet; } static bool declscompatible(const struct decl *a, const struct decl *b) { if (a->t != b->t) return 0; - if (a->t == Dfn && a->fn.selfty == b->fn.selfty && !a->fn.body) + if (a->t == Dfn && a->externp == b->externp && a->fn.selfty == b->fn.selfty && !a->fn.body) + return 1; + if (a->t == Dstatic && a->externp == b->externp && a->var.ty == b->var.ty && !a->var.ini) return 1; if (a->t == Dtype && a->ty == b->ty) return 1; |