Skip to content

Conversation

chbrown
Copy link

@chbrown 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
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
Copy link
Member

👍

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or to 'core.ts'.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
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
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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants