Skip to content

Commit

Permalink
Add TODO to remove TryTarget::Task
Browse files Browse the repository at this point in the history
  • Loading branch information
agu-z committed Oct 15, 2024
1 parent 3f7db2b commit e59a11f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion crates/compiler/can/src/desugar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ pub fn desugar_expr<'a>(
| Crash => loc_expr,

Var { module_name, ident } => {
// TODO remove when purity inference fully replaces Task
// [purity-inference] TODO: only in Task mode
if ident.ends_with('!') {
env.arena.alloc(Loc::at(
Expand Down
6 changes: 2 additions & 4 deletions crates/compiler/parse/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ pub enum StrLiteral<'a> {
/// Values that can be tried, extracting success values or "returning early" on failure
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TryTarget {
// TODO: Remove when purity inference replaces Task fully
/// Tasks suffixed with ! are `Task.await`ed
Task,
/// Results suffixed with ? are `Result.try`ed
Expand Down Expand Up @@ -583,10 +584,7 @@ pub fn is_expr_suffixed(expr: &Expr) -> bool {
Expr::Var {
module_name: _,
ident,
} => {
// TODO remove when purity inference fully replaces Task
ident.ends_with('!')
}
} => ident.ends_with('!'),

Expr::TrySuffix { .. } => true,

Expand Down

0 comments on commit e59a11f

Please sign in to comment.