From 0ce51e684f8ba4134e8fbdbdc4dcb82c27e51af8 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 30 Jan 2015 18:22:12 -0800 Subject: [PATCH] Fix #1871 by ensuring the at we get the canonical filename before we check the extension --- src/compiler/program.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 9b52b8dc9ca..ecd8fd71f88 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -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)) {