Skip to content

Commit

Permalink
Update type checker
Browse files Browse the repository at this point in the history
  • Loading branch information
osa1 committed Jan 22, 2025
1 parent 9ffb73f commit 65b5bae
Show file tree
Hide file tree
Showing 5 changed files with 288 additions and 333 deletions.
2 changes: 1 addition & 1 deletion src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ pub enum SelfParam {
Inferred,

/// Function signature has a `self` parameter with explicit type signature.
Explicit(L<Type>),
Explicit(Type),
}

#[derive(Debug, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion src/ast/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ impl FunSig {
}
SelfParam::Explicit(ty) => {
buffer.push_str("self: ");
ty.node.print(buffer);
ty.print(buffer);
if !self.params.is_empty() {
buffer.push_str(", ");
}
Expand Down
2 changes: 1 addition & 1 deletion src/parser.lalrpop
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ FunSig: (Option<L<Id>>, L<Id>, FunSig) = {
}
self_ = match param_ty {
None => SelfParam::Inferred,
Some(ty) => SelfParam::Explicit(ty),
Some(ty) => SelfParam::Explicit(ty.node),
};
} else {
match param_ty {
Expand Down
4 changes: 2 additions & 2 deletions src/parser.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// auto-generated: "lalrpop 0.22.0"
// sha3: f29e9af2bd7cc34226fd49342a8058ae56e0299b586cb3bc3b1dca66c78319db
// sha3: 857086d3194941087844d3d0d094985a4bac0b38fdf0ba0424dd60262fbebb4f
#![allow(clippy::all)]
use crate::ast::*;
use crate::interpolation::{copy_update_escapes, parse_string_parts};
Expand Down Expand Up @@ -41357,7 +41357,7 @@ fn __action39<'a>(
}
self_ = match param_ty {
None => SelfParam::Inferred,
Some(ty) => SelfParam::Explicit(ty),
Some(ty) => SelfParam::Explicit(ty.node),
};
} else {
match param_ty {
Expand Down
Loading

0 comments on commit 65b5bae

Please sign in to comment.