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?
to your account
The parser in package gccgoimporter does not seem to handle type conversion expressions exported by gccgo. For example, the following constant:
type Units string
const Bits = Units("bits")
gets exported by gccgo in a .gox file as a const value wrapped in a type conversion:
const Bits <type 1 "Units" <type -16>> = convert(<type 1>, "bits");
When gccgoimporter tries to parse this const in gccgoimporter.(*parser).parseConstValue, it appears to only expect a constant string, literal, int, or float on the RHS of a const assignment, so we get the error:
import error some/package/path:48:49 (byte offset = 10429): expected const value,
got Ident ("convert"))
The importer in the gccgo frontend, however, handles this type conversion properly (see relevant source snippet here).
The text was updated successfully, but these errors were encountered:
CL https://golang.org/cl/33412 mentions this issue.
Sorry, something went wrong.
No branches or pull requests