-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.RefactoringIssues related to refactoring toolsIssues related to refactoring toolsToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.
Milestone
Description
The inliner replaces parameters by their arguments when possible. If the argument is a constant, then certain expressions that were statically valid (but would panic if evaluated) before are now statically invalid. For example, attempting to slice an empty string:
func _() {
const s = ""
f(s)
}
func (s string) { _ = s[:1] } // error: cannot slice empty string
or negating minint:
func _() {
const x = -0x80000000
f(x)
}
func f(x int32) { var _ int32 = -x } // error: - -0x80000000 overflows int32
In general I suspect such errors cannot be detected without executing the type checker on the result, which is not something that can be done by the inliner itself. Sigh.
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.RefactoringIssues related to refactoring toolsIssues related to refactoring toolsToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.