CDPR-Modding-Documentation / CDPR-Modding-Documentation/REDkit-bugtracker

witcherscript, annotations: @addMethod forces `public` access modifier

Open
#1 0 comments 1 reaction 0 assignees View on GitHub
Scripting
Dominant language
No language data
Stars
7
Forks
1
PR merge metrics
No merged PRs in 30d

Description

In the current state, no matter the provided access modifier during a `@addMethod` the function is always added using `public`

Using the following code:
```js
class ParentClass {
protected function main() {}
}

class ChildClass {}
```

If the `main` function is added via an annotation:
```js
@addMethod(ChildClass)
protected function main() {}
```

This results in the following error:
```
Function 'main' cannot have a weaker access modifier than in ancestor class 'ParentClass'.
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.