8000 Fix #1871 by ensuring the at we get the canonical filename before we … · ezhangle/TypeScript@0ce51e6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0ce51e6

Browse files
committed
Fix microsoft#1871 by ensuring the at we get the canonical filename before we check the extension
1 parent 9a6e3ad commit 0ce51e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ module ts {
176176
}
177177
var diagnostic: DiagnosticMessage;
178178
if (hasExtension(filename)) {
179-
if (!options.allowNonTsExtensions && !fileExtensionIs(filename, ".ts")) {
179+
if (!options.allowNonTsExtensions && !fileExtensionIs(host.getCanonicalFileName(filename), ".ts")) {
180180
diagnostic = Diagnostics.File_0_must_have_extension_ts_or_d_ts;
181181
}
182182
else if (!findSourceFile(filename, isDefaultLib, refFile, refPos, refEnd)) {

0 commit comments

Comments
 (0)
0