Fix #1871 by ensuring the at we get the canonical filename before we check the extension

This commit is contained in:
Mohamed Hegazy 2015-01-30 18:22:12 -08:00
parent 9a6e3ad52d
commit 0ce51e684f

View File

@ -176,7 +176,7 @@ module ts {
}
var diagnostic: DiagnosticMessage;
if (hasExtension(filename)) {
if (!options.allowNonTsExtensions && !fileExtensionIs(filename, ".ts")) {
if (!options.allowNonTsExtensions && !fileExtensionIs(host.getCanonicalFileName(filename), ".ts")) {
diagnostic = Diagnostics.File_0_must_have_extension_ts_or_d_ts;
}
else if (!findSourceFile(filename, isDefaultLib, refFile, refPos, refEnd)) {