Skip to content

Commit 8c1bc30

Browse files
committed
different
1 parent 1e90efa commit 8c1bc30

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

src/Lean/Compiler/LCNF/Specialize.lean

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import Lean.Compiler.LCNF.Simp
1313
import Lean.Compiler.LCNF.ToExpr
1414
import Lean.Compiler.LCNF.Level
1515
import Lean.Compiler.LCNF.Closure
16-
import Std.Data.Iterators.Combinators
17-
import Std.Data.Iterators.Producers.Monadic.Array
1816

1917
namespace Lean.Compiler.LCNF
2018
namespace Specialize
@@ -418,22 +416,14 @@ mutual
418416
return some (.const declName usNew argsNew)
419417
else
420418
let specDecl ← mkSpecDecl decl us argMask params decls levelParamsNew
421-
let targetParams : Std.HashSet Arg ←
422-
args.iterM SpecializeM
423-
|>.zip (paramsInfo.iterM _)
424-
|>.foldM (init := {}) fun acc (arg, info) => do
425-
match info with
426-
| .fixedInst | .fixedNeutral | .other => return acc
427-
| .fixedHO | .user =>
428-
-- TODO: check fixedInst matching here
429-
match arg with
430-
| .type .. | .erased => return acc
431-
| .fvar fvar =>
432-
if (← findParam? fvar).isSome then
433-
return acc.insert arg
434-
else
435-
return acc
436-
let parentMask := argsNew.map targetParams.contains
419+
let parentMask ← argsNew.mapM
420+
fun
421+
| .type .. | .erased => return false
422+
| .fvar fvar => do
423+
if let some param ← findParam? fvar then
424+
return (param.type matches .forallE ..) && !(← isArrowClass? param.type).isSome
425+
else
426+
return false
437427
cacheSpec key specDecl.name
438428
specDecl.saveBase
439429
let specDecl ← specDecl.etaExpand

0 commit comments

Comments
 (0)