Skip to content

Commit

Permalink
reset vars in a couple more places
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellwrosen committed Dec 10, 2024
1 parent ef2df94 commit d272484
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions parser-typechecker/src/Unison/Syntax/TermPrinter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ printLetBinding :: (MonadPretty v m) => AmbientContext -> (v, Term3 v PrintAnnot
printLetBinding context (v, binding) =
if Var.isAction v
then pretty0 context binding
else renderPrettyBinding <$> prettyBinding0' context (HQ.unsafeFromVar v) binding
else renderPrettyBinding <$> prettyBinding0' context (HQ.unsafeFromVar (Var.reset v)) binding

prettyPattern ::
forall v loc.
Expand Down Expand Up @@ -1317,7 +1317,7 @@ printAnnotate n tm =
Set.fromList [n | v <- ABT.allVars tm, n <- varToName v]
usedTypeNames =
Set.fromList [n | Ann' _ ty <- ABT.subterms tm, v <- ABT.allVars ty, n <- varToName v]
varToName v = toList (Name.parseText (Var.name v))
varToName = toList . Name.parseText . Var.name . Var.reset
go :: (Ord v) => Term2 v at ap v b -> Term2 v () () v b
go = extraMap' id (const ()) (const ())

Expand Down Expand Up @@ -2213,7 +2213,7 @@ avoidShadowing tm (PrettyPrintEnv terms types) =
in (HQ'.NameOnly fullName, HQ'.NameOnly resuffixifiedName)
tweak _ p = p
varToName :: (Var v) => v -> [Name]
varToName = toList . Name.parseText . Var.name
varToName = toList . Name.parseText . Var.name . Var.reset

isLeaf :: Term2 vt at ap v a -> Bool
isLeaf (Var' {}) = True
Expand Down
10 changes: 5 additions & 5 deletions unison-src/transcripts/idempotent/fix-5427.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bar =
change:
⍟ These new definitions are ok to `add`:
bar : Nat
foo : Nat
```
Expand All @@ -43,9 +43,9 @@ scratch/main> view bar
bar : Nat
bar =
foo1 _ =
foo _ =
_ = foo
foo
.foo
foo()
```

Expand Down Expand Up @@ -82,7 +82,7 @@ baz = foo + foo
change:
⍟ These new definitions are ok to `add`:
bar : Nat
baz : Nat
foo : Nat
Expand Down Expand Up @@ -117,7 +117,7 @@ bar =
⍟ These names already exist. You can `update` them to your
new definition:
bar : Nat
foo : Nat
```
Expand Down

0 comments on commit d272484

Please sign in to comment.