Skip to content

Commit

Permalink
Skip pattern attributes in interpreter.
Browse files Browse the repository at this point in the history
  • Loading branch information
athas committed Aug 9, 2024
1 parent 7060c9f commit 4d41d88
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
* Obscure issue related to replications of constants in complex
intrablock kernels.

* Interpreter no longer crashes on attributes in patterns.

## [0.25.19]

### Added
Expand Down
2 changes: 2 additions & 0 deletions src/Language/Futhark/Interpreter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ matchPat env p v = do
Just env' -> pure env'

patternMatch :: Env -> Pat (TypeBase Size u) -> Value -> MaybeT EvalM Env
patternMatch env (PatAttr _ p _) val =
patternMatch env p val
patternMatch env (Id v (Info t) _) val =
lift $
pure $
Expand Down
3 changes: 3 additions & 0 deletions tests/attributes/params1.fut
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
-- ==
-- input { 10 } output { 20 }

def main (x: i32) =
loop (#[maxval(1337)] acc : i32) = x for i < 10 do x + x

0 comments on commit 4d41d88

Please sign in to comment.