Commit 706b54bb authored by Matthew Dempsky's avatar Matthew Dempsky
Browse files

cmd/compile: fix ICE due to bad rune width

It was possible that

    var X interface{} = 'x'

could cause a compilation failure due to having not calculated rune's
width yet. typecheck.go normally calculates the width of things, but
it doesn't for implicit conversions to default type. We already
compute the width of all of the standard numeric types in universe.go,
but we failed to calculate it for the rune alias type. So we could
later crash if the code never otherwise explicitly mentioned 'rune'.

While here, explicitly compute widths for 'byte' and 'error' for
consistency.

Fixes #29350.

Change-Id: Ifedd4899527c983ee5258dcf75aaf635b6f812f8
Reviewed-on: https://go-review.googlesource.com/c/155380


Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
parent 8ff04a99
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment