From 50f0cf7f2042702c8d91b0c5ca3f3474a9254fe2 Mon Sep 17 00:00:00 2001 From: "P. Oscar Boykin" Date: Fri, 22 Nov 2024 09:27:16 -1000 Subject: [PATCH] minor cleanup --- core/src/main/scala/org/bykn/bosatsu/Package.scala | 7 +++---- core/src/main/scala/org/bykn/bosatsu/PackageMap.scala | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/scala/org/bykn/bosatsu/Package.scala b/core/src/main/scala/org/bykn/bosatsu/Package.scala index 87787f49d..8abad1e4a 100644 --- a/core/src/main/scala/org/bykn/bosatsu/Package.scala +++ b/core/src/main/scala/org/bykn/bosatsu/Package.scala @@ -531,10 +531,9 @@ object Package { pack.program._2(n) def filterLets(fn: Identifier => Boolean): Typed[A] = { - val lets = pack.program._1.lets - val prog1: Program[TypeEnv[Kind.Arg], TypedExpr[A], Any] = - pack.program._1.copy(lets = lets.filter { case (b, _, _) => fn(b) }) - pack.copy(program = (prog1, pack.program._2)) + val (prog, importMap) = pack.program + val prog1 = prog.copy(lets = prog.lets.filter { case (b, _, _) => fn(b) }) + pack.copy(program = (prog1, importMap)) } } diff --git a/core/src/main/scala/org/bykn/bosatsu/PackageMap.scala b/core/src/main/scala/org/bykn/bosatsu/PackageMap.scala index 651125876..2318733f4 100644 --- a/core/src/main/scala/org/bykn/bosatsu/PackageMap.scala +++ b/core/src/main/scala/org/bykn/bosatsu/PackageMap.scala @@ -92,6 +92,7 @@ object PackageMap { def treeShake[A](p: Typed[A], roots: Set[(PackageName, Identifier)]): Typed[A] = { type Ident = (PackageName, Identifier) + def dependency(a: Ident): Iterable[Ident] = p.toMap.get(a._1) match { case Some(pack) =>