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

[error TS2612: Property '' will overwrite the base property in #286

Closed
1 task done
Sandeep-Malhotra opened this issue Jul 31, 2024 · 1 comment
Closed
1 task done
Labels
bug Something isn't working duplicate This issue or pull request already exists new

Comments

@Sandeep-Malhotra
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Nature of Your Project

TypeScript

Current Behavior

Error
error TS2612: Property 'ID' will overwrite the base property in '_cuidAspect<{ new (...args: any[]): _managedAspect.managed; prototype: _managedAspect.managed; readonly actions: Record<never, never>; } & TBase>.cuid & _managedAspect.managed & object'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.

Entity Definition in service file

 entity ShiftHeaders         as
        projection on db.ShiftHeader {
            *
        }
        excluding {
            createdAt,
            createdBy,
            modifiedAt,
            modifiedBy
        };

Entity defined in db file

entity ShiftHeader : cuid, managed {
    nextCursor     :      db.WorkForceCursor;
    updateSequence :      Composition[1, * ] of ShiftRecord
                              on updateSequence.updateSequenceId = ID;
    errors         : many db.WorkforceError;
    warnings       : many db.WorkForceWarning;

}

Type generated in index.ts

export function _ShiftHeaderAspect<TBase extends new (...args: any[]) => object>(Base: TBase) {
  return class ShiftHeader extends _._cuidAspect(_._managedAspect(Base)) {
        ID?: string;
        nextCursor?: _stce_api.WorkForceCursor | null;
        updateSequence?: __.Composition.of.many<ShiftRecord_>;
        errors?: Array<_stce_api.WorkforceError>;
        warnings?: Array<_stce_api.WorkForceWarning>;
      static readonly actions: Record<never, never>
  };
}

Expected Behavior

Types must be generated without error

Steps To Reproduce

No response

Environment

- **OS**:
- **Node**:
- **npm**:
- **cds-typer**: 
- **cds**:

Repository Containing a Minimal Reproducible Example

No response

Anything else?

No response

@Sandeep-Malhotra Sandeep-Malhotra added bug Something isn't working new labels Jul 31, 2024
@daogrady
Copy link
Contributor

Duplicate of #274

@daogrady daogrady marked this as a duplicate of #274 Jul 31, 2024
@daogrady daogrady added the duplicate This issue or pull request already exists label Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists new
Projects
None yet
Development

No branches or pull requests

2 participants