Skip to content

Commit

Permalink
fix: make array access index exp inference correct
Browse files Browse the repository at this point in the history
  • Loading branch information
aboeglin committed Mar 27, 2024
1 parent 62849ef commit c7b85b0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions compiler/main/Infer/Exp.hs
Original file line number Diff line number Diff line change
Expand Up @@ -602,11 +602,11 @@ inferArrayAccess :: Options -> Env -> Can.Exp -> Infer (Substitution, [Pred], Ty
inferArrayAccess options env (Can.Canonical area (Can.ArrayAccess arr index)) = do
tv <- newTVar Star
(s1, ps1, t1, earr) <- infer options env arr
(_, ps2, t2, eindex) <- infer options env index
(s2, ps2, t2, eindex) <- infer options env index
s3 <- contextualUnify env arr t1 (tArrayOf tv)
s4 <- contextualUnify env index t2 tInteger

let s = s4 `compose` s3 `compose` s1
let s = s4 `compose` s3 `compose` s2 `compose` s1
let t = apply s tv
let ps = ps1 ++ ps2

Expand Down
2 changes: 1 addition & 1 deletion madlib.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cabal-version: 2.0
-- see: https://github.com/sol/hpack

name: madlib
version: 0.23.0
version: 0.23.1
description: Please see the README on GitHub at <https://github.com/madlib-lang/madlib#readme>
homepage: https://github.com/madlib-lang/madlib#readme
bug-reports: https://github.com/madlib-lang/madlib/issues
Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: madlib
version: 0.23.0
version: 0.23.1
github: "madlib-lang/madlib"
license: BSD3
author: "Arnaud Boeglin, Brekk Bockrath"
Expand Down
2 changes: 1 addition & 1 deletion pkg/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@madlib-lang/madlib",
"version": "0.23.0",
"version": "0.23.1",
"main": "./src/run.js",
"bin": {
"madlib": "src/run.js"
Expand Down

0 comments on commit c7b85b0

Please sign in to comment.