Commit f9285818 authored by Robert Griesemer's avatar Robert Griesemer
Browse files

go/types, types2: fix string to type parameter conversions

Converting an untyped constant to a type parameter results
in a non-constant value; but the constant must still be
representable by all specific types of the type parameter.

Adjust the special handling for constant-to-type parameter
conversions to also include string-to-[]byte and []rune
conversions, which are handled separately for conversions
to types that are not type parameters because those are not
constant conversions in non-generic code.

Fixes #51386.

Change-Id: I15e5a0fd281efd15af387280cd3dee320a1ac5e1
Reviewed-on: https://go-review.googlesource.com/c/go/+/388254


Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: default avatarRobert Findley <rfindley@google.com>
parent eb8198d2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment