-
Notifications
You must be signed in to change notification settings - Fork 584
More type checking #373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More type checking #373
Conversation
props []string | ||
} | ||
|
||
var getFeatureMap = sync.OnceValue(func() map[string][]FeatureMapEntry { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could probably just be a global; I don't think we need this to be lazy. Though I doubt the compiler is actually able to statically create this for us (so will in effect just create an init
method to do it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like having it be lazy. That way, in a program with no errors it will never be created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like that's somewhat overkill given all of our other globals that will also never be used most of the time, but, it is what the old code did, so 😄
internal/checker/utilities.go
Outdated
return scanner.GetRangeOfTokenAtPosition(ast.GetSourceFileOfNode(node), pos) | ||
} | ||
|
||
func symbolName(symbol *ast.Symbol) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is duplicated with ast.SymbolName
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup
@@ -456,15 +456,24 @@ var exclusivelyPrefixedNodeCoreModules = map[string]bool{ | |||
} | |||
|
|||
func (p *Program) GetEmitModuleFormatOfFile(sourceFile *ast.SourceFile) core.ModuleKind { | |||
return p.GetEmitModuleFormatOfFileWorker(sourceFile, p.compilerOptions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the workers here if we're just directly calling them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not, I just ported what was there.
internal/core/core.go
Outdated
minJ = 1 | ||
} | ||
maxJ := int(math.Floor(maxValue + float64(i))) | ||
if maxJ > len(s2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the merge conflicts go away and CI runs, I suspect that some of this will have lint messages asking to use max
/min
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix it.
@@ -131,6 +131,11 @@ CompilerOptions::{ | |||
"tscBuild": null | |||
} | |||
Output:: | |||
project/index.ts(1,19): error TS2307: Cannot find module '../utils' or its corresponding type declarations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this is interesting; implies we aren't resolving something anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the issue is that we weren't resolving previously. I'm not sure what the purpose of this test is, but it looks like the error is legit.
Hm, this seems to have broken tests in #275, with traces like:
Should really get those tests in now that they're fast. |
In this PR: