took a look at the code here: https://typescript.codeplex.com/SourceControl/latest#src/compiler/tsc.ts
when compiling it's adding the lib.d.ts to the compiler's list of files, just like any other file:
resolve() :
if (includeDefaultLibrary) {
var libraryResolvedFile: IResolvedFile = {
path: this.getDefaultLibraryFilePath(),
referencedFiles: [],
importedFiles: []
};
// Prepend the library to the resolved list
resolvedFiles = [libraryResolvedFile].concat(resolvedFiles);
}
compile() :
this.resolvedFiles.forEach(resolvedFile => {
var sourceFile = this.getSourceFile(resolvedFile.path);
compiler.addFile(resolvedFile.path, sourceFile.scriptSnapshot, sourceFile.byteOrderMark, /*version:*/ 0, /*isOpen:*/ false, resolvedFile.referencedFiles);
});
once I started doing the same the compilation errors went away. must be this step wasn't necessary in older versions of the compiler?