Skip to content

Commit

Permalink
Fix #2210.
Browse files Browse the repository at this point in the history
  • Loading branch information
athas committed Jan 22, 2025
1 parent 8abb2f9 commit de5d041
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
* Handling of module-dependent size expressions in type abbreviations
(#2209).

* A `let`-bound size would mistakenly be in scope of the bound
expression (#2210).

## [0.25.26]

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/Language/Futhark/TypeChecker/Names.hs
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ resolveAppExp (Match e cases loc) =
resolvePat p $ \p' -> CasePat p' <$> resolveExp body <*> pure cloc
resolveAppExp (LetPat sizes p e1 e2 loc) = do
checkForDuplicateNames (map sizeBinderToParam sizes) [p]
e1' <- resolveExp e1
resolveSizes sizes $ \sizes' -> do
e1' <- resolveExp e1
resolvePat p $ \p' -> do
e2' <- resolveExp e2
pure $ LetPat sizes' p' e1' e2' loc
Expand Down
7 changes: 7 additions & 0 deletions tests/shapes/letshape12.fut
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- #2210
-- ==
-- error: Unknown name "n"

def f : [42]f32 =
let [n] turtle: f32 -> [n]f32 = \(x: f32) -> replicate n x
in turtle 42

0 comments on commit de5d041

Please sign in to comment.