Repository navigation
Answer null and and rather than guessing a nearby name - #213
Merged
Merged
Conversation
An unresolved name gets a suggestion from edit distance, which is right
for a typo and wrong for a word that belongs to another language. `null`
used to come back as:
error[DEED3001]: cannot find `null` in this scope
help: there is a `f` in scope
| f
That is a confident answer to a question nobody asked, and applying it
would replace the reader's mistake with a stranger one.
`null`, `nil`, `undefined`, `None` and `none` now say there is no empty
value, and that something which might be absent is a `Result` or a
`choice` with a variant for the absence, which is how `Option` gets
declared when a program wants one.
`and`, `or` and `not` are the same idea under a different spelling, so
they get `&&`, `||` and `!` and a machine-applicable fix. `a and b` was
already reporting `cannot find 'and'`, but underneath a warning that the
`a` on its own goes nowhere, so the reader met the wrong message first
and it offered to write `let _ =` in front of their expression. Running
`deed fix` on that file now leaves `a && b`, and it checks clean.
`self` and `this` get the no-methods rule, which is the same thing
`xs.length()` is told a layer up.
None of this shadows anything. A name that resolves never reaches the
place this is decided, so a program that declares a function called `and`
still has one, and there is a test holding that down.
This was referenced Jul 27, 2026
onatozmenn
added a commit
that referenced
this pull request
Aug 2, 2026
A `where` clause holding `and` stopped at the word, answered with the block that did not follow it, and then with a type error about a body the parser never reached. The resolver has had the right answer since #213 and never got to give it: a bare name is only an expression where a statement can start, and a contract clause is not one. Counted across the eighteen recorded model runs, the word reached the parser seventeen times and the resolver zero. DEED2020 now. The word is read in the operator's position, with the operator's precedence, so `n > 0 and n < 10 or n == 20` parses to the tree the symbols would have given, the clause is the one that was written, and `deed fix` writes the symbol. `not` goes in front of a value rather than between two and still reaches the resolver, which the resolver test now says. Closes #865.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Last batch from the newcomer sweep. An unresolved name gets a suggestion from edit distance, which is right for a typo and wrong for a word that belongs to another language:
Applying that would swap the reader's mistake for a stranger one.
null,nil,undefined,Noneandnonenow say there's no empty value, and that something which might be absent is aResultor achoicewith a variant for the absence. That's howexamples/generic_types.deed:26declaresOption, so it isn't a dead end.and,orandnotare the same idea under a different spelling, so they get&&,||and!with a machine-applicable fix.a and bwas already reportingcannot find 'and'but it sat underneath a warning that theaon its own goes nowhere, so the first thing the reader met was an offer to writelet _ =in front of their expression.deed fixnow leavesa && band the file checks clean, I ran that.selfandthisget the no-methods rule, same thingxs.length()is told a layer up in #211.Nothing here shadows anything, since a name that resolves never reaches this point. A program that declares its own
andstill has one and there's a test for that direction.That's the sweep done except
n as String(silent) andfor i in 0..10(DEED4022 doesn't mention there are no ranges). Both want a bit more thought about where the message belongs.Investigated with AI assistance.