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

src/compiler/parser.ts exports function with return type of private interface #1112

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@chbrown
Copy link

chbrown commented Nov 10, 2014

Export ReferencePathMatchResult interface to fix 'error TS4060: Return type of exported function has or is using private name' when generating declarations from src/compiler/*.ts.

See #1111

Tests run just fine.

29974 passing (2m)

chbrown added some commits Nov 10, 2014

Export ReferencePathMatchResult to fix 'error TS4060: Return type of …
…exported function has or is using private name'
@chbrown

This comment has been minimized.

Copy link
Author

chbrown commented Nov 10, 2014

I meant that second fix to be a separate PR, but it's just another one-liner in the same file, so maybe you can grab them at the same time?

@sheetalkamat

This comment has been minimized.

Copy link
Member

sheetalkamat commented Nov 10, 2014

👍

@@ -1,6 +1,7 @@
/// <reference path="types.ts"/>
/// <reference path="core.ts"/>
/// <reference path="scanner.ts"/>
/// <reference path="checker.ts"/>

This comment has been minimized.

@mhegazy

mhegazy Nov 10, 2014

Contributor

The parser should not include the checker. it is the other way around. think of them as layers. the type system is a higher layer than syntax.

if there is a dependency the right thing is to move the dependency to types.ts

This comment has been minimized.

@CyrusNajmabadi

CyrusNajmabadi Nov 10, 2014

Contributor

or to 'core.ts'.

This comment has been minimized.

@chbrown

chbrown Nov 10, 2014

Author

That makes sense structurally, but parser.ts explicitly calls the function createTypeChecker on line 4298, which is defined in checker.ts (line 64). The reason why it compiles successfully in the jake local call is because checker.ts is explicitly included in the tsc command line arguments.

You can see the issue by running:

node bin/tsc --out tmp.js src/compiler/parser.ts

src/compiler/parser.ts(4298,50): error TS2304: Cannot find name 'createTypeChecker'.

@mhegazy

This comment has been minimized.

Copy link
Contributor

mhegazy commented Nov 10, 2014

i you want the declaration, just run:

jake declaration local

This will generate a tsc.d.ts and typescriptservices.d.ts emitted in the built\local directory, obviously you still need the export you identified.

@mhegazy

This comment has been minimized.

Copy link
Contributor

mhegazy commented Nov 17, 2014

The interface should be exported now.

@mhegazy mhegazy closed this Nov 17, 2014

@Microsoft Microsoft locked and limited conversation to collaborators Jun 18, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.