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

Make TemplateConfig fields public to avoid "cannot access private field" error #9

Merged
merged 1 commit into from
Jun 16, 2024

Conversation

gechandesu
Copy link
Contributor

Since V 0.4.6 accessing to private fields produces an error e.g.:

 FAIL  [1/4] C:   735.4 ms, R:     0.000 ms /home/ge/Code/whisker/spec/spec_test.v
>> compilation failed:
spec/spec_test.v:21:43: error: cannot access private field `input` on `template.TemplateConfig`
   19 |         for test in suite.tests {
   20 |             println('${suite.name}: ${test.name}')
   21 |             spec_template := template.from_strings(input: test.template, partials: test.partials)!
      |                                                    ~~~~~~~~~~~~~~~~~~~~
   22 |             output := spec_template.run(test.data)!
   23 |             // dump(output)
spec/spec_test.v:21:65: error: cannot access private field `partials` on `template.TemplateConfig`
   19 |         for test in suite.tests {
   20 |             println('${suite.name}: ${test.name}')
   21 |             spec_template := template.from_strings(input: test.template, partials: test.partials)!
      |                                                                          ~~~~~~~~~~~~~~~~~~~~~~~
   22 |             output := spec_template.run(test.data)!
   23 |             // dump(output)

this commit fixes it.

Checklist

  • The project compiles with v . and v -prod ..
  • The unit tests are passing with v test .
  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • There exists a corresponding issue as a Bug Report or a
    Feature Request.
  • (Optional) I have contacted the developers and received
    feedback on the aforementioned issue.

@hungrybluedev hungrybluedev merged commit 2b11140 into hungrybluedev:main Jun 16, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants