Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: error on impl trait for dyn trait #227

Open
2 tasks done
matthiaskrgr opened this issue Jun 2, 2024 · 0 comments
Open
2 tasks done

bug: error on impl trait for dyn trait #227

matthiaskrgr opened this issue Jun 2, 2024 · 0 comments
Labels

Comments

@matthiaskrgr
Copy link

Did you check existing issues?

  • I have read all the tree-sitter docs if it relates to using the parser
  • I have searched the existing issues of tree-sitter-rust

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

No response

Describe the bug

FP error as rustc accepts this code (although with a warning)

Steps To Reproduce/Bad Parse Tree

(source_file (trait_item (visibility_modifier) name: (type_identifier) body: (declaration_list)) (impl_item trait: (type_identifier) (ERROR) type: (bounded_type (tuple_type (scoped_type_identifier path: (scoped_identifier path: (scoped_identifier name: (identifier)) name: (identifier)) name: (type_identifier))) (type_identifier)) body: (declaration_list)))

source_file [0, 0] - [5, 0]
trait_item [0, 0] - [0, 25]
visibility_modifier [0, 0] - [0, 3]
name: type_identifier [0, 17] - [0, 22]
body: declaration_list [0, 23] - [0, 25]
impl_item [2, 0] - [2, 54]
trait: type_identifier [2, 12] - [2, 17]
ERROR [2, 22] - [2, 25]
type: bounded_type [2, 26] - [2, 50]
tuple_type [2, 26] - [2, 43]
scoped_type_identifier [2, 27] - [2, 42]
path: scoped_identifier [2, 27] - [2, 37]
path: scoped_identifier [2, 27] - [2, 32]
name: identifier [2, 29] - [2, 32]
name: identifier [2, 34] - [2, 37]
name: type_identifier [2, 39] - [2, 42]
type_identifier [2, 46] - [2, 50]
body: declaration_list [2, 51] - [2, 54]

Expected Behavior/Parse Tree

looks like ts does not know about impl .. for dyn yet.
I guess the `dyn' should just be part of the bounded type?

Repro

pub unsafe trait Trait {}

unsafe impl Trait for dyn (::std::any::Any) + Send { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant