mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 19:50:14 +01:00
FIXME -> TODO for C++ style (#1282)
This commit is contained in:
@@ -402,7 +402,7 @@ auto TypeChecker::ArgumentDeduction(
|
||||
if (!IsConcreteType(param_type)) {
|
||||
// Parameter type contains a nested `auto` and argument type isn't the
|
||||
// same kind of type.
|
||||
// FIXME: This seems like something we should be able to accept.
|
||||
// TODO: This seems like something we should be able to accept.
|
||||
return CompilationError(source_loc) << "type error in " << context << "\n"
|
||||
<< "expected: " << *param_type << "\n"
|
||||
<< "actual: " << *arg_type;
|
||||
@@ -536,7 +536,7 @@ auto TypeChecker::ArgumentDeduction(
|
||||
case Value::Kind::NominalClassType: {
|
||||
const auto& param_class_type = cast<NominalClassType>(*param_type);
|
||||
if (arg_type->kind() != Value::Kind::NominalClassType) {
|
||||
// FIXME: We could determine the parameters of the class from field
|
||||
// TODO: We could determine the parameters of the class from field
|
||||
// types in a struct argument.
|
||||
return handle_non_deduced_type();
|
||||
}
|
||||
@@ -573,7 +573,7 @@ auto TypeChecker::ArgumentDeduction(
|
||||
}
|
||||
// For the following cases, we check the type matches.
|
||||
case Value::Kind::StaticArrayType:
|
||||
// FIXME: We could deduce the array type from an array or tuple argument.
|
||||
// TODO: We could deduce the array type from an array or tuple argument.
|
||||
case Value::Kind::ContinuationType:
|
||||
case Value::Kind::ChoiceType:
|
||||
case Value::Kind::IntType:
|
||||
@@ -639,7 +639,7 @@ auto TypeChecker::Substitute(
|
||||
const auto& fn_type = cast<FunctionType>(*type);
|
||||
auto param = Substitute(dict, &fn_type.parameters());
|
||||
auto ret = Substitute(dict, &fn_type.return_type());
|
||||
// FIXME: Only remove the bindings that are in `dict`; we may still need
|
||||
// TODO: Only remove the bindings that are in `dict`; we may still need
|
||||
// to do deduction.
|
||||
return arena_->New<FunctionType>(param, llvm::None, ret, llvm::None,
|
||||
llvm::None);
|
||||
@@ -995,7 +995,7 @@ auto TypeChecker::TypeCheckExp(Nonnull<Expression*> e,
|
||||
<< "struct " << *struct_type
|
||||
<< " does not have a field named " << access.field();
|
||||
}
|
||||
// FIXME: We should handle all types here, not only structs. For
|
||||
// TODO: We should handle all types here, not only structs. For
|
||||
// example:
|
||||
// fn Main() -> i32 {
|
||||
// class Class { var n: i32; };
|
||||
@@ -1167,7 +1167,7 @@ auto TypeChecker::TypeCheckExp(Nonnull<Expression*> e,
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// FIXME: Consider setting the static type of all interface member
|
||||
// TODO: Consider setting the static type of all interface member
|
||||
// declarations and instance member declarations to be member name
|
||||
// types, rather than special-casing member accesses that name
|
||||
// them.
|
||||
@@ -1860,7 +1860,7 @@ auto TypeChecker::TypeCheckStmt(Nonnull<Statement*> s,
|
||||
auto& var = cast<VariableDefinition>(*s);
|
||||
CARBON_RETURN_IF_ERROR(TypeCheckExp(&var.init(), impl_scope));
|
||||
const Value& rhs_ty = var.init().static_type();
|
||||
// FIXME: If the pattern contains a binding that implies a new impl is
|
||||
// TODO: If the pattern contains a binding that implies a new impl is
|
||||
// available, should that remain in scope for as long as its binding?
|
||||
// ```
|
||||
// var a: (T:! Widget) = ...;
|
||||
|
||||
@@ -643,7 +643,7 @@ class InterfaceType : public Value {
|
||||
}
|
||||
auto args() const -> const BindingMap& { return args_; }
|
||||
|
||||
// FIXME: These aren't used for anything yet.
|
||||
// TODO: These aren't used for anything yet.
|
||||
auto impls() const -> const ImplExpMap& { return impls_; }
|
||||
auto witnesses() const -> const ImplWitnessMap& { return witnesses_; }
|
||||
|
||||
|
||||
@@ -308,7 +308,7 @@ primary_expression:
|
||||
$$ = arena->New<IntTypeLiteral>(context.source_loc());
|
||||
}
|
||||
| SELF
|
||||
// FIXME: Should we create a new TypeLiteral for `Self`?
|
||||
// TODO: Should we create a new TypeLiteral for `Self`?
|
||||
{ $$ = arena->New<IdentifierExpression>(context.source_loc(), "Self"); }
|
||||
| STRING
|
||||
{ $$ = arena->New<StringTypeLiteral>(context.source_loc()); }
|
||||
@@ -933,7 +933,7 @@ declaration:
|
||||
// TODO: Type of `Self` should be the interface being declared, not
|
||||
// `Type`.
|
||||
auto ty_ty = arena -> New<TypeTypeLiteral>(context.source_loc());
|
||||
// FIXME: Should this be switched to use a `SelfDeclaration` instead?
|
||||
// TODO: Should this be switched to use a `SelfDeclaration` instead?
|
||||
auto self =
|
||||
arena -> New<GenericBinding>(context.source_loc(), "Self", ty_ty);
|
||||
$$ = arena->New<InterfaceDeclaration>(context.source_loc(), $2, $3, self,
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
package ExplorerTest api;
|
||||
|
||||
var v: i32;
|
||||
// FIXME: This should probably be valid if we allow global variables at all.
|
||||
// TODO: This should probably be valid if we allow global variables at all.
|
||||
// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/alias/fail_alias_var.carbon:[[@LINE+1]]: invalid target for alias declaration
|
||||
alias A = v;
|
||||
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ alias i32IM = i32.(IM);
|
||||
|
||||
fn Main() -> i32 {
|
||||
var a: A = {.n = 0};
|
||||
// FIXME: Use != once we support it.
|
||||
// TODO: Use != once we support it.
|
||||
if (not (A.(IF)() == 1)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,6 @@ fn GetY(T:! Type, pt: Point(T)) -> T {
|
||||
|
||||
fn Main() -> i32 {
|
||||
var p: Point(i32) = {.x = 1, .y = 2};
|
||||
// FIXME: Should `GetX({.x = 1, .y = 2})` work? See #1251.
|
||||
// TODO: Should `GetX({.x = 1, .y = 2})` work? See #1251.
|
||||
return GetX(p) + GetY(i32, {.x = 3, .y = 4});
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ auto Driver::RunFullCommand(llvm::ArrayRef<llvm::StringRef> args) -> bool {
|
||||
|
||||
auto Driver::RunHelpSubcommand(DiagnosticConsumer& /*consumer*/,
|
||||
llvm::ArrayRef<llvm::StringRef> args) -> bool {
|
||||
// FIXME: We should support getting detailed help on a subcommand by looking
|
||||
// TODO: We should support getting detailed help on a subcommand by looking
|
||||
// for it as a positional parameter here.
|
||||
if (!args.empty()) {
|
||||
ReportExtraArgs("help", args);
|
||||
@@ -93,7 +93,7 @@ auto Driver::RunHelpSubcommand(DiagnosticConsumer& /*consumer*/,
|
||||
|
||||
for (auto subcommand_and_help : SubcommandsAndHelp) {
|
||||
llvm::StringRef subcommand_text = subcommand_and_help[0];
|
||||
// FIXME: We should wrap this to the number of columns left after the
|
||||
// TODO: We should wrap this to the number of columns left after the
|
||||
// subcommand on the terminal, and using a hanging indent.
|
||||
llvm::StringRef help_text = subcommand_and_help[1];
|
||||
output_stream_ << " "
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// Note: X-macro header. Do not use include guards.
|
||||
|
||||
#ifndef CARBON_SUBCOMMAND
|
||||
// FIXME: We should expand `HelpText` to be a short help name, a synopsis, and a
|
||||
// TODO: We should expand `HelpText` to be a short help name, a synopsis, and a
|
||||
// long-form description.
|
||||
#define CARBON_SUBCOMMAND(Name, Spelling, HelpText)
|
||||
#endif
|
||||
|
||||
@@ -166,7 +166,7 @@ class TokenizedBuffer::Lexer {
|
||||
case ' ':
|
||||
case '\t':
|
||||
// Skip other forms of whitespace while tracking column.
|
||||
// FIXME: This obviously needs looooots more work to handle unicode
|
||||
// TODO: This obviously needs looooots more work to handle unicode
|
||||
// whitespace as well as special handling to allow better tokenization
|
||||
// of operators. This is just a stub to check that our column
|
||||
// management works.
|
||||
|
||||
@@ -253,7 +253,7 @@ class ParseTree::Node {
|
||||
// Returns an opaque integer identifier of the node in the tree. Clients
|
||||
// should not expect any particular semantics from this value.
|
||||
//
|
||||
// FIXME: Maybe we can switch to stream operator overloads?
|
||||
// TODO: Maybe we can switch to stream operator overloads?
|
||||
[[nodiscard]] auto index() const -> int { return index_; }
|
||||
|
||||
// Prints the node index.
|
||||
|
||||
@@ -341,7 +341,7 @@ TEST_F(ParseTreeTest, FunctionDeclarationSkipIndentedNewlineUntilOutdent) {
|
||||
}
|
||||
|
||||
TEST_F(ParseTreeTest, FunctionDeclarationSkipWithoutSemiToCurly) {
|
||||
// FIXME: We don't have a grammar construct that uses curlies yet so this just
|
||||
// TODO: We don't have a grammar construct that uses curlies yet so this just
|
||||
// won't parse at all. Once it does, we should ensure that the close brace
|
||||
// gets properly parsed for the struct (or whatever other curly-braced syntax
|
||||
// we have grouping function declarations) despite the invalid function
|
||||
@@ -660,12 +660,12 @@ TEST_F(ParseTreeTest, OperatorWhitespaceErrors) {
|
||||
{"var n: i8 = (n)*3;", Valid},
|
||||
{"var n: i8 = 3*(n);", Valid},
|
||||
{"var n: i8 = n *n;", Recovered},
|
||||
// FIXME: We could figure out that this first Failed example is infix
|
||||
// TODO: We could figure out that this first Failed example is infix
|
||||
// with one-token lookahead.
|
||||
{"var n: i8 = n* n;", Failed},
|
||||
{"var n: i8 = n* -n;", Failed},
|
||||
{"var n: i8 = n* *p;", Failed},
|
||||
// FIXME: We try to form (n*)*p and reject due to missing parentheses
|
||||
// TODO: We try to form (n*)*p and reject due to missing parentheses
|
||||
// before we notice the missing whitespace around the second `*`.
|
||||
// It'd be better to (somehow) form n*(*p) and reject due to the missing
|
||||
// whitespace around the first `*`.
|
||||
|
||||
@@ -432,7 +432,7 @@ auto ParseTree::Parser::ParseCodeBlock() -> llvm::Optional<Node> {
|
||||
if (!ParseStatement()) {
|
||||
// We detected and diagnosed an error of some kind. We can trivially skip
|
||||
// to the actual close curly brace from here.
|
||||
// FIXME: It would be better to skip to the next semicolon, or the next
|
||||
// TODO: It would be better to skip to the next semicolon, or the next
|
||||
// token at the start of a line with the same indent as this one.
|
||||
SkipTo(tokens_.GetMatchedClosingToken(open_curly));
|
||||
has_errors = true;
|
||||
@@ -468,7 +468,7 @@ auto ParseTree::Parser::ParseFunctionDeclaration() -> Node {
|
||||
CARBON_DIAGNOSTIC(ExpectedFunctionName, Error,
|
||||
"Expected function name after `fn` keyword.");
|
||||
emitter_.Emit(*position_, ExpectedFunctionName);
|
||||
// FIXME: We could change the lexer to allow us to synthesize certain
|
||||
// TODO: We could change the lexer to allow us to synthesize certain
|
||||
// kinds of tokens and try to "recover" here, but unclear that this is
|
||||
// really useful.
|
||||
SkipPastLikelyEnd(function_intro_token, handle_semi_in_error_recovery);
|
||||
@@ -965,7 +965,7 @@ auto ParseTree::Parser::ParseOperatorExpression(
|
||||
NextTokenKind(), IsTrailingOperatorInfix())) {
|
||||
auto [operator_precedence, is_binary] = *trailing_operator;
|
||||
|
||||
// FIXME: If this operator is ambiguous with either the ambient precedence
|
||||
// TODO: If this operator is ambiguous with either the ambient precedence
|
||||
// or the LHS precedence, and there's a variant with a different fixity
|
||||
// that would work, use that one instead for error recovery.
|
||||
if (PrecedenceGroup::GetPriority(ambient_precedence, operator_precedence) !=
|
||||
@@ -1119,7 +1119,7 @@ auto ParseTree::Parser::ParseKeywordStatement(ParseNodeKind kind,
|
||||
CARBON_DIAGNOSTIC(ExpectedSemiAfter, Error, "Expected `;` after `{0}`.",
|
||||
TokenKind);
|
||||
emitter_.Emit(*position_, ExpectedSemiAfter, keyword_kind);
|
||||
// FIXME: Try to skip to a semicolon to recover.
|
||||
// TODO: Try to skip to a semicolon to recover.
|
||||
}
|
||||
return AddNode(kind, keyword, start, /*has_error=*/!semi || arg_error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user