Skip to content

Commit 53b7d6c

Browse files
authored
Merge pull request #5779 from unisonweb/713-fuzzy-name-res
2 parents 46c2eaa + ae7eb8f commit 53b7d6c

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
lines changed

parser-typechecker/src/Unison/PrintError.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ renderTypeError e env src = case e of
740740
]
741741
),
742742
"\n\n",
743-
Pr.wrap "I found some terms in scope that have matching names and types. Maybe you meant one of these:",
743+
Pr.wrap "I found some terms in scope that have matching names and types. Was any of these what you wanted?",
744744
"\n\n",
745745
intercalateMap "\n" (renderSuggestion env) suggestionsRightNameRightType
746746
]
@@ -889,9 +889,9 @@ renderTypeError e env src = case e of
889889
"different name",
890890
pl "" "s",
891891
". ",
892-
"Maybe you meant ",
893-
pl "this" "one of these",
894-
":\n\n"
892+
"Was ",
893+
pl "this" "any of these",
894+
" what you wanted?\n\n"
895895
]
896896
)
897897
preambleDifferentNameWrongType pl =
@@ -908,9 +908,9 @@ renderTypeError e env src = case e of
908908
"different type",
909909
pl "" "s",
910910
". ",
911-
"Maybe you meant ",
912-
pl "this" "one of these",
913-
":\n\n"
911+
"Was ",
912+
pl "this" "any of these",
913+
" what you wanted?\n\n"
914914
]
915915
)
916916
formatWrongs txt wrongs =

unison-src/transcripts-manual/rewrites.output.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ scratch/main> load
339339
19 | bar21
340340
341341
I found a term in scope with a similar name but a different
342-
type. Maybe you meant this:
342+
type. Was this what you wanted?
343343
344344
bar1 : Nat
345345
```
@@ -392,7 +392,7 @@ scratch/main> load
392392
6 | a1
393393
394394
I found some terms in scope with similar names but different
395-
types. Maybe you meant one of these:
395+
types. Was any of these what you wanted?
396396
397397
(<|) : (i ->{g} o) -> i ->{g} o
398398
Bytes.at : Nat -> Bytes -> Optional Nat

unison-src/transcripts/idempotent/destructuring-binds.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ ex4 =
9090
2 | (a,b) = (a Nat.+ b, 19)
9191
9292
I found some terms in scope with similar names but different
93-
types. Maybe you meant one of these:
93+
types. Was any of these what you wanted?
9494
9595
(Float.*) : Float -> Float -> Float
9696
(Int.*) : Int -> Int -> Int

unison-src/transcripts/idempotent/fix845.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Now, typecheck a file with a reference to `Blah.zonk` (which doesn't exist in th
4343
2 | > Blah.zonk [1,2,3]
4444
4545
I found some terms in scope with similar names but different
46-
types. Maybe you meant one of these:
46+
types. Was any of these what you wanted?
4747
4848
Text.zonk : Text -> Text
4949
List.zonk : [a] -> [a]

unison-src/transcripts/idempotent/name-resolution-fuzzy.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ myFunction = TRuncate
6565
4 | myFunction = TRuncate
6666
6767
I found some terms in scope with similar names but different
68-
types. Maybe you meant one of these:
68+
types. Was any of these what you wanted?
6969
7070
truncate0 : Int -> Nat
7171
truncate : Float -> Int
@@ -86,7 +86,7 @@ myFunction = builtin.io2.Ref.ca1
8686
4 | myFunction = builtin.io2.Ref.ca1
8787
8888
I found a term in scope with a similar name but a different
89-
type. Maybe you meant this:
89+
type. Was this what you wanted?
9090
9191
cas : Ref {IO} a -> Ticket a -> a ->{IO} Boolean
9292
```
@@ -117,7 +117,7 @@ x = biz.bete
117117
2 | x = biz.bete
118118
119119
I found some terms in scope with similar names but different
120-
types. Maybe you meant one of these:
120+
types. Was any of these what you wanted?
121121
122122
byte : Boolean
123123
bite : Nat
@@ -141,7 +141,7 @@ myFunction = Flat.TRuncate2x4
141141
3 | myFunction = Flat.TRuncate2x4
142142
143143
I found some terms in scope with similar names but different
144-
types. Maybe you meant one of these:
144+
types. Was any of these what you wanted?
145145
146146
truncate : Float -> Int
147147
truncate0 : Int -> Nat
@@ -162,7 +162,7 @@ myFunction = X
162162
4 | myFunction = X
163163
164164
I found some terms in scope with similar names but different
165-
types. Maybe you meant one of these:
165+
types. Was any of these what you wanted?
166166
167167
(Float.*) : Float -> Float -> Float
168168
(Int.*) : Int -> Int -> Int
@@ -184,7 +184,7 @@ myFunction = In.X
184184
4 | myFunction = In.X
185185
186186
I found some terms in scope with similar names but different
187-
types. Maybe you meant one of these:
187+
types. Was any of these what you wanted?
188188
189189
(Int.*) : Int -> Int -> Int
190190
(Int.+) : Int -> Int -> Int
@@ -216,7 +216,7 @@ f =
216216
10 | if A then xYzlmno else ()
217217
218218
I found some terms in scope with similar names but different
219-
types. Maybe you meant one of these:
219+
types. Was any of these what you wanted?
220220
221221
(Float.*) : Float -> Float -> Float
222222
(Int.*) : Int -> Int -> Int
@@ -244,7 +244,7 @@ f =
244244
10 | if R.xYzlmno then A else ()
245245
246246
I found a term in scope with a similar name but a different
247-
type. Maybe you meant this:
247+
type. Was this what you wanted?
248248
249249
L.xyzlmno : Int
250250
```

unison-src/transcripts/idempotent/name-resolution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ bar = foo + 10
388388
The name foo is ambiguous. Its type should be: Nat
389389
390390
I found some terms in scope that have matching names and
391-
types. Maybe you meant one of these:
391+
types. Was any of these what you wanted?
392392
393393
file.foo : Nat
394394
ns.foo : Nat

unison-src/transcripts/idempotent/resolution-failures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ useAmbiguousTerm = ambiguousTerm
111111
by type, as any type would work here.
112112
113113
I found some terms in scope that have matching names and
114-
types. Maybe you meant one of these:
114+
types. Was any of these what you wanted?
115115
116116
one.ambiguousTerm : Text
117117
two.ambiguousTerm : Text

unison-src/transcripts/idempotent/suffixes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ scratch/main> add
108108
by type, as any type would work here.
109109
110110
I found some terms in scope that have matching names and
111-
types. Maybe you meant one of these:
111+
types. Was any of these what you wanted?
112112
113113
cool.abra.cadabra : Text
114114
distributed.abra.cadabra : Text

0 commit comments

Comments
 (0)