fix #14585, fix #17589: access to static param now works (#17590)

This commit is contained in:
Timothee Cour 2021-03-31 02:25:26 -07:00 • committed by GitHub
commit 6d7d1e60fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 58 additions and 2 deletions

View file

@ -67,7 +67,7 @@ const
tyAlias, tyInferred, tySink, tyOwned}
# see also ast.abstractVarRange
abstractInst* = {tyGenericInst, tyDistinct, tyOrdinal, tyTypeDesc, tyAlias,
tyInferred, tySink, tyOwned}
tyInferred, tySink, tyOwned} # xxx what about tyStatic?
abstractInstOwned* = abstractInst + {tyOwned}
skipPtrs* = {tyVar, tyPtr, tyRef, tyGenericInst, tyTypeDesc, tyAlias,
tyInferred, tySink, tyLent, tyOwned}

View file

@ -980,7 +980,7 @@ proc genBindSym(c: PCtx; n: PNode; dest: var TDest) =
proc fitsRegister*(t: PType): bool =
assert t != nil
t.skipTypes(abstractInst-{tyTypeDesc}).kind in {
t.skipTypes(abstractInst + {tyStatic} - {tyTypeDesc}).kind in {
tyRange, tyEnum, tyBool, tyInt..tyUInt64, tyChar}
proc ldNullOpcode(t: PType): TOpcode =