mirror of
https://github.com/leanprover/lean4.git
synced 2026-03-17 18:34:06 +00:00
fix: @[nospecialize] is never template-like (#12663)
This PR avoids false-positive error messages on specialization restrictions under the module system when the declaration is explicitly marked as not specializable. It could also provide some minor public size and rebuild savings.
This commit is contained in:
committed by
GitHub
parent
65e5053008
commit
d0f8eb7bd6
@@ -1017,7 +1017,7 @@ Return `true` if `decl` is supposed to be inlined/specialized.
|
||||
-/
|
||||
def Decl.isTemplateLike (decl : Decl pu) : CoreM Bool := do
|
||||
let env ← getEnv
|
||||
if ← hasLocalInst decl.type then
|
||||
if !hasNospecializeAttribute env decl.name && (← hasLocalInst decl.type) then
|
||||
return true -- `decl` applications will be specialized
|
||||
else if (← isImplicitReducible decl.name) then
|
||||
return true -- `decl` is "fuel" for code specialization
|
||||
|
||||
Reference in New Issue
Block a user