Skip to content

Commit

Permalink
Merge instance information when merging packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
augustss committed Nov 11, 2024
1 parent 4c8bfb6 commit 70df575
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/MicroHs/TypeCheck.hs
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ emptyGlobTables :: GlobTables
emptyGlobTables = GlobTables { gSynTable = M.empty, gClassTable = M.empty, gInstInfo = M.empty }

mergeGlobTables :: GlobTables -> GlobTables -> GlobTables
mergeGlobTables g1 g2 = GlobTables { gSynTable = M.merge (gSynTable g1) (gSynTable g2),
gClassTable = M.merge (gClassTable g1) (gClassTable g2),
gInstInfo = M.merge (gInstInfo g1) (gInstInfo g2) }
mergeGlobTables g1 g2 =
GlobTables { gSynTable = M.merge (gSynTable g1) (gSynTable g2),
gClassTable = M.merge (gClassTable g1) (gClassTable g2),
gInstInfo = M.mergeWith mergeInstInfo (gInstInfo g1) (gInstInfo g2) }

type Symbols = (SymTab, SymTab)

Expand Down

0 comments on commit 70df575

Please sign in to comment.