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

ts2c/src/types.js:625 #40

Closed
zaoqi opened this issue Apr 28, 2019 · 3 comments
Closed

ts2c/src/types.js:625 #40

zaoqi opened this issue Apr 28, 2019 · 3 comments

Comments

@zaoqi
Copy link

zaoqi commented Apr 28, 2019

https://gitlab.com/the-language/the-language/blob/dab7bd014e15d4f06e09fae039679a96a34945e9/core/pure/typescript/lang.ts

$ ts2c lang.ts
/home/zaoqi/.config/yarn/global/node_modules/ts2c/src/types.js:625
            var propType = this.convertType(propTsType, declaration.name) || exports.PointerVarType;
                                                                    ^

TypeError: Cannot read property 'name' of undefined
    at TypeHelper.generateStructure (/home/zaoqi/.config/yarn/global/node_modules/ts2c/src/types.js:625:69)
    at TypeHelper.convertType (/home/zaoqi/.config/yarn/global/node_modules/ts2c/src/types.js:608:35)
    at TypeHelper.getCType (/home/zaoqi/.config/yarn/global/node_modules/ts2c/src/types.js:257:39)
    at /home/zaoqi/.config/yarn/global/node_modules/ts2c/src/types.js:526:80
    at Array.forEach (<anonymous>)
    at TypeHelper.resolveTypes (/home/zaoqi/.config/yarn/global/node_modules/ts2c/src/types.js:526:23)
    at TypeHelper.inferTypes (/home/zaoqi/.config/yarn/global/node_modules/ts2c/src/types.js:522:14)
    at newConstructor.CProgram (/home/zaoqi/.config/yarn/global/node_modules/ts2c/src/program.js:146:25)
    at new newConstructor (/home/zaoqi/.config/yarn/global/node_modules/ts2c/src/template.js:26:35)
    at Object.<anonymous> (/home/zaoqi/.config/yarn/global/node_modules/ts2c/bin/ts2c:14:14)
$ yarn global list
yarn global v1.15.2
warning package.json: No license field
info "gulp-cli@2.2.0" has binaries:
   - gulp
info "hexo-cli@1.1.0" has binaries:
   - hexo
info "ts2c@2.2.6" has binaries:
   - ts2c
Done in 0.65s.
@andrei-markeev
Copy link
Owner

andrei-markeev commented Apr 30, 2019

The file is too huge, when reporting bugs, please provide an MCVE.

Also, the file includes export statements. As I mentioned in ES6 module issue, you should compile entry point of the program rather than individual modules.

@zaoqi-unsafe
Copy link

I don't know where ts2c is translating.

I will write a program to modify the result to get the module I want.

@andrei-markeev
Copy link
Owner

I don't know where ts2c is translating.

ts2c is experiencing an error while processing this huge file, so there's no output.

I tried to debug it with the latest dev version of ts2c, and now the error is completely different and happens when processing function make_error_v on line 936. But this function has many dependencies and it is totally impossible to understand what is happening there.

I appreciate the bug report, but at this point, let's not try to transpile such big real-world files. I need a very small example that I can work with.

As the original error no longer happens and because minimal example was not provided, I am closing this.

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

No branches or pull requests

3 participants