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

generated typescript files are not compiling with latest version(2.7.0-dev.20171207) of ts #4533

Closed
chandu0101 opened this issue Dec 11, 2017 · 3 comments · Fixed by #4540
Closed

Comments

@chandu0101
Copy link

model.fbs

namespace hello;
table Point {
    x: float;
    y: float;
}
root_type Point;

model_generated.ts

export namespace hello {
  export class Point {
    /**
     * @type {flatbuffers.ByteBuffer}
     */
    bb: flatbuffers.ByteBuffer;

    /**
     * @type {number}
     */
    bb_pos: number = 0;
    /**
     * @param {number} i
     * @param {flatbuffers.ByteBuffer} bb
     * @returns {Point}
     */
    __init(i: number, bb: flatbuffers.ByteBuffer): Point {
      this.bb_pos = i;
      this.bb = bb;
      return this;
    }
 ....

Compile Error:

model_generated.ts(12,5): error TS2564: Property 'bb' has no initializer and is not definitely assigned in the constructor. src/model_generated.ts(12,5): error TS2564: Property 'bb' has no initializer and is not definitely assigned in the constructor.

Reason : microsoft/TypeScript#20075

Workaround : "strictPropertyInitialization": false,

@chandu0101 chandu0101 changed the title generated typescript files are not compiling with latest version(Version 2.7.0-dev.20171207) of ts generated typescript files are not compiling with latest version(2.7.0-dev.20171207) of ts Dec 11, 2017
@aardappel
Copy link
Collaborator

@krojew is this worth fixing?

@krojew
Copy link
Contributor

krojew commented Dec 11, 2017

Absolutely yes. Will take a look as soon as I have some time.

@hhpop
Copy link

hhpop commented Feb 16, 2018

bb!: flatbuffers.ByteBuffer;

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

Successfully merging a pull request may close this issue.

4 participants