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

Hardcode constructor annotation to 1-arity #156

Open
eed3si9n opened this issue Jan 15, 2023 · 0 comments
Open

Hardcode constructor annotation to 1-arity #156

eed3si9n opened this issue Jan 15, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@eed3si9n
Copy link
Collaborator

Ref #143

steps

// TODO: The last argument should become class_parameters
class A @Inject()(x: Int, y: Int) {
  def x = 1
}

problem

(compilation_unit [0, 0] - [5, 0]
  (comment [0, 0] - [0, 57])
  (class_definition [1, 0] - [3, 1]
    name: (identifier [1, 6] - [1, 7])
    (annotation [1, 8] - [1, 33]
      name: (type_identifier [1, 9] - [1, 15])
      arguments: (arguments [1, 15] - [1, 17])
      arguments: (arguments [1, 17] - [1, 33]
        (ascription_expression [1, 18] - [1, 24]
          (identifier [1, 18] - [1, 19])
          (type_identifier [1, 21] - [1, 24]))
        (ascription_expression [1, 26] - [1, 32]
          (identifier [1, 26] - [1, 27])
          (type_identifier [1, 29] - [1, 32]))))
    body: (template_body [1, 34] - [3, 1]
      (function_definition [2, 2] - [2, 11]
        name: (identifier [2, 6] - [2, 7])
        body: (integer_literal [2, 10] - [2, 11])))))

expectations

@smarter wrote:

I think people usually annotate constructors with java annotations where you always have exactly one parameter list.

So I guess, we can hardcode to 1-arity when we find a constructor annotation for now.

Originally posted by @smarter in #143 (comment)

@ckipp01 ckipp01 added the enhancement New feature or request label Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants