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

"aztec-cli codegen" typescript files fail to typecheck #4152

Closed
olehmisar opened this issue Jan 19, 2024 · 3 comments
Closed

"aztec-cli codegen" typescript files fail to typecheck #4152

olehmisar opened this issue Jan 19, 2024 · 3 comments

Comments

@olehmisar
Copy link
Contributor

aztec-cli codegen --ts generated code:

export class TokenBridgeContract extends ContractBase {
  /** Type-safe wrappers for the public methods exposed by the contract. */
  public methods!: {
    ...
  }
}

The error:

token_bridge/target/TokenBridge.ts:81:10 - error TS2612: Property 'methods' will overwrite the base property in 'ContractBase'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.

81   public methods!: {

How to fix:

- public methods!: {
+ declare public methods: {
@rahul-kothari
Copy link
Contributor

We do public override methods which fixes this

@github-project-automation github-project-automation bot moved this from Todo to Done in A3 May 7, 2024
@olehmisar
Copy link
Contributor Author

@rahul-kothari i can confirm that this is NOT fixed. The declare keyword is needed to calm typescript down:

- public override methods!
+ declare public methods
image image

@olehmisar
Copy link
Contributor Author

fixed by #8267

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
2 participants