CDPR-Modding-Documentation / CDPR-Modding-Documentation/REDkit-bugtracker
witcherscript, annotations: @addMethod forces `public` access modifier
Open
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.