Report exposed-but-not-defined symbols

This commit is contained in:
Richard Feldman 2020-12-10 23:17:10 -05:00
parent 14288d5aa6
commit ed222912b3
3 changed files with 16 additions and 2 deletions

View file

@ -37,6 +37,19 @@ pub fn can_problem<'b>(
alloc.module(module_id),
alloc.reflow(" isn't used, you don't need to import it."),
]),
Problem::ExposedButNotDefined(symbol) => {
alloc.stack(vec![
alloc
.symbol_unqualified(symbol)
.append(alloc.reflow(" is listed as exposed, but it isn't defined in this module.")),
alloc
.reflow("You can fix this by adding a definition for ")
.append(alloc.symbol_unqualified(symbol))
.append(alloc.reflow(", or by removing it from "))
.append(alloc.keyword("exposes"))
.append(alloc.reflow("."))
])
}
Problem::UnusedArgument(closure_symbol, argument_symbol, region) => {
let line = "\". Adding an underscore at the start of a variable name is a way of saying that the variable is not used.";