mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 16:52:18 +01:00
check: ban bulk methods on slices of refined types
This commit is contained in:
1 parent
be9d3fcf0f
commit
d60bfb05e8
1 file changed
+4
-3
+4
-3
@@ -756,10 +756,11 @@ func (q *checker) tcheckDot(n *a.Expr, depth uint32) error {
|
|||||||
if q.c.isBuiltInSliceFunc(qqid, lTyp) {
|
if q.c.isBuiltInSliceFunc(qqid, lTyp) {
|
||||||
bulky := false
|
bulky := false
|
||||||
switch qqid[2] {
|
switch qqid[2] {
|
||||||
case t.IDBulkLoadHostEndian:
|
case t.IDBulkLoadHostEndian, t.IDBulkMemset, t.IDBulkSaveHostEndian:
|
||||||
case t.IDBulkMemset:
|
|
||||||
case t.IDBulkSaveHostEndian:
|
|
||||||
bulky = true
|
bulky = true
|
||||||
|
if lTyp.Innermost().IsRefined() {
|
||||||
|
return fmt.Errorf("check: cannot apply bulk methods to slices of refined numeric types")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !bulky || lTyp.Inner().IsBulkNumType() {
|
if !bulky || lTyp.Inner().IsBulkNumType() {
|
||||||
|
|||||||
Reference in new issue
Block a user