-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/gcimporter: treat unknown constant values the same as invalid
Fixes a crash resulting from trying to convert an unknown constant value. Fixes golang/go#60605 Change-Id: If6b831b8fe2f9690b9f89e191b329eb7660f5e14 Reviewed-on: https://go-review.googlesource.com/c/tools/+/501209 TryBot-Bypass: Robert Findley <[email protected]> gopls-CI: kokoro <[email protected]> Run-TryBot: Robert Findley <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
- Loading branch information
Showing
3 changed files
with
81 additions
and
43 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
gopls/internal/regtest/marker/testdata/diagnostics/issue60605.txt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
This test verifies that we can export constants with unknown kind. | ||
Previously, the exporter would panic while attempting to convert such constants | ||
to their target type (float64, in this case). | ||
|
||
-- go.mod -- | ||
module mod.txt/p | ||
|
||
go 1.20 | ||
-- p.go -- | ||
package p | ||
|
||
const EPSILON float64 = 1e- //@diag(re"1e-()", re"exponent has no digits") |
This file contains 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
This file contains 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