Skip to content

Commit

Permalink
Fix interface method body
Browse files Browse the repository at this point in the history
  • Loading branch information
hydroper committed May 3, 2024
1 parent 88d3a45 commit 97f0594
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "as3_parser"
version = "1.0.9"
version = "1.0.10"
edition = "2021"
authors = ["hydroper <[email protected]>"]
repository = "https://github.com/hydroper/as3parser"
Expand Down
6 changes: 3 additions & 3 deletions crates/parser/parser/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3727,10 +3727,10 @@ impl<'input> Parser<'input> {

// Body verification.
//
// Note that interface methods must have a body unlike in Java.
if (has_native || has_abstract) && common.body.is_some() {
// Note that interface methods must never have a body unlike in Java.
if (interface_method || has_native || has_abstract) && common.body.is_some() {
self.add_syntax_error(&name.location(), DiagnosticKind::FunctionMustNotContainBody, diagarg![]);
} else if (interface_method || !(has_native || has_abstract)) && common.body.is_none() {
} else if !(has_native || has_abstract) && common.body.is_none() {
self.add_syntax_error(&name.location(), DiagnosticKind::FunctionMustContainBody, diagarg![]);
}

Expand Down

0 comments on commit 97f0594

Please sign in to comment.