Skip to content

NoScriptAccess for constructor #444

Description

@CrosRoad95

Hello again! i would like to disallow user to use class constrator and force to use method, how can i do this?
NoScriptAccess is not allowed for constructor

public class Foo{
  public Foo() {} // new Foo() should not be allowed
}

public class Bar{
  Foo CreateFoo(){ return new Foo(); }
}
new Foo() // throw exception
let bar = new Bar()
let foo = bar.CreateFoo() // ok

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions