We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ab17ec commit 010f428Copy full SHA for 010f428
compiler-core/src/error.rs
@@ -2259,7 +2259,13 @@ but no type in scope with that name."
2259
let text = if *type_with_name_in_scope {
2260
wrap_format!("`{name}` is a type, it cannot be used as a value.")
2261
} else {
2262
- wrap_format!("The name `{name}` is not in scope here.")
+ let is_first_char_uppercase = name.chars().next().is_some_and(char::is_uppercase);
2263
+
2264
+ if is_first_char_uppercase {
2265
+ wrap_format!("The custom type variant constructor `{name}` is not in scope here.")
2266
+ } else {
2267
+ wrap_format!("The name `{name}` is not in scope here.")
2268
+ }
2269
};
2270
Diagnostic {
2271
title: "Unknown variable".into(),
0 commit comments