Repository navigation
The default library is found next to tslang when no path is given - #626
Merged
Merged
Conversation
With neither --default-lib-path nor DEFAULT_LIB_PATH, getDefaultLibPath returned "", so the library was looked for in ./defaultlib of the current folder: tslang compiled with no default library unless it ran from its own folder. --install-default-lib already installs into the folder of tslang when not told where; compiling now looks there too, when it holds defaultlib. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With neither
--default-lib-pathnorDEFAULT_LIB_PATHset,getDefaultLibPath()returned"", so tslang looked fordefaultlib/in the current folder. Run from anywhere else, it compiled with no default library (can't resolve name: Map).--install-default-libalready installs into tslang's own folder when not told where, so the install and the compile disagreed.Fix
getDefaultLibPath()(exe.cpp) now falls back to the folder of tslang itself, when that folder holdsdefaultlib. Order:--default-lib-path,DEFAULT_LIB_PATH, tslang's folder, then the current folder as before. A tslang without adefaultlibbeside it is unchanged.Testing
DEFAULT_LIB_PATHunset:--emit=exeand--emit=jitboth resolveMapand run. The released tslang fails there.--no-default-libstill disables it.ctest -C Release: 4834/4834 passed (buildbinfolders hold nodefaultlib, so the suite is unaffected).🤖 Generated with Claude Code