Skip to content
This repository was archived by the owner on Nov 24, 2020. It is now read-only.
This repository was archived by the owner on Nov 24, 2020. It is now read-only.

Declaring a function with parameter called version produce a non-valid code in target typescript-node server code #35

@icaaro

Description

@icaaro

When in sdkgen is created a function with param called "version" this produce a compile errors in node-server target.

Following below the error text produced by the behavior above.

ERROR in [at-loader] ./src/user/api.ts:2268:48 
        TS7022: 'version' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
    
    ERROR in [at-loader] ./src/user/api.ts:2268:109 
        TS2448: Block-scoped variable 'version' used before its declaration.
    
    ERROR in [at-loader] ./src/user/api.ts:2301:48 
        TS7022: 'version' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
    
    ERROR in [at-loader] ./src/user/api.ts:2301:118 
        TS2448: Block-scoped variable 'version' used before its declaration.
    
    ERROR in [at-loader] ./src/user/api.ts:2334:48 
        TS7022: 'version' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
    
    ERROR in [at-loader] ./src/user/api.ts:2334:111 
        TS2448: Block-scoped variable 'version' used before its declaration.
    
    ERROR in [at-loader] ./src/user/api.ts:2367:48 
        TS7022: 'version' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer
        
 ERROR in [at-loader] ./src/user/api.ts:2367:116 
        TS2448: Block-scoped variable 'version' used before its declaration.`

This bug is introduced by 0cbc20c commit. in the following line
@io << ident ident ident ident "const {key, expirationSeconds, version} = await cacheConfig.#{op.pretty_name} (#{(["ctx"] + op.args.map(&.name)).join(", ")});\n"

I'm think the same occurs with functions with parameters called "key" and "expirationSeconds" .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions