-
Notifications
You must be signed in to change notification settings - Fork 12.8k
reference path with quotes doesnot have same result as in old compiler #474
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
Comments
quotes in file names are accepted by the file system so there is no reason to disallow them. |
Old compiler could parse the below reference as li'b/class'A.d.ts /// <reference path='li'b/class'A.d.ts' />
declare class ClassC extends test.ClassA {
} New one parses this as li @mhegazy we want to behave like old compiler here right? Or should user be writing the reference as "li'b/class'A.d.ts" instead? |
@sheetalkamat "Li'b/class'A" looks more correct. |
Doesn't this basically mean that 'reference' tags are limited to a 'path' attribute? Kind of defeats the purpose of even having made it a tag. |
@DanielRosenwasser makes sense. Then maybe we should check for valid XML attribute. |
That’s not legal XML, so we shouldn’t support it. However, it’s also a breaking change, so we must support it.
From: Sheetal Nandi [mailto:[email protected]] Old compiler could parse the below reference as li'b/class'A.d.ts /// <reference path='li'b/class'A.d.ts' /> declare class ClassC extends test.ClassA { } New one parses this as li @mhegazyhttps://github.com/mhegazy we want to behave like old compiler here right? Or should user be writing the reference as "li'b/class'A.d.ts" instead? — |
Then let's "deprecate" that style by parsing it the right way, and falling back to the old behavior if that fails. When we have to default to the old behavior, issue a warning. The biggest problem is that we don't have a good dichotomy for warnings and errors - so really we'd like to warn in the parser, but instead we fail hard as soon as we issue any sort of diagnostic in the parser. |
Because it seems like a bug in the old compiler, and even if it was intentional, I don't believe it was right. If we're entirely certain that no attributes will be added, then by all means, it doesn't matter, but it just gives more weight to suggestions like #488. |
…that quotes in file name wouldnt affect reference resolution Fixes #474
New compiler:
tsc tests\baselines\reference\project\quotesInFileAndDirectoryNames\node\m'ain.d.ts
Error:
tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.d.ts(1,1): File 'tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/li.ts' not found.
Old compiler:
No error
Note we either need to fix the reference path resolution for the quotes, or fix the declaration emitter to handle the quotes correctly in reference path
The text was updated successfully, but these errors were encountered: