length := int64(-1) // valid if >= 0
switch u := coreString(x.typ).(type) {
case nil:
- check.errorf(x, NonSliceableOperand, invalidOp+"cannot slice %s: %s has no core type", x, x.typ)
+ check.errorf(x, NonSliceableOperand, invalidOp+"cannot slice %s: %s has no common underlying type", x, x.typ)
x.mode = invalid
return
}
case single && !core.tilde:
if traceInference {
- u.tracef("-> set type parameter %s to constraint core type %s", tpar, core.typ)
+ u.tracef("-> set type parameter %s to constraint's common underlying type %s", tpar, core.typ)
}
// The corresponding type argument tx is unknown and the core term
// describes a single specific type and no tilde.
}
core := coreString(params.At(n - 1).typ)
if _, ok := core.(*Slice); !ok && !isString(core) {
- panic(fmt.Sprintf("got %s, want variadic parameter with unnamed slice type or string as core type", core.String()))
+ panic(fmt.Sprintf("got %s, want variadic parameter with unnamed slice type or string as common underlying type", core.String()))
}
}
sig := &Signature{recv: recv, params: params, results: results, variadic: variadic}
length := int64(-1) // valid if >= 0
switch u := coreString(x.typ).(type) {
case nil:
- check.errorf(x, NonSliceableOperand, invalidOp+"cannot slice %s: %s has no core type", x, x.typ)
+ check.errorf(x, NonSliceableOperand, invalidOp+"cannot slice %s: %s has no common underlying type", x, x.typ)
x.mode = invalid
return
}
case single && !core.tilde:
if traceInference {
- u.tracef("-> set type parameter %s to constraint core type %s", tpar, core.typ)
+ u.tracef("-> set type parameter %s to constraint's common underlying type %s", tpar, core.typ)
}
// The corresponding type argument tx is unknown and the core term
// describes a single specific type and no tilde.
}
core := coreString(params.At(n - 1).typ)
if _, ok := core.(*Slice); !ok && !isString(core) {
- panic(fmt.Sprintf("got %s, want variadic parameter with unnamed slice type or string as core type", core.String()))
+ panic(fmt.Sprintf("got %s, want variadic parameter with unnamed slice type or string as common underlying type", core.String()))
}
}
sig := &Signature{recv: recv, params: params, results: results, variadic: variadic}
type myByte1 []byte
type myByte2 []byte
func _[T interface{ []byte | myByte1 | myByte2 }] (x T, i, j, k int) { var _ T = x[i:j:k] }
-func _[T interface{ []byte | myByte1 | []int }] (x T, i, j, k int) { var _ T = x /* ERROR "no core type" */ [i:j:k] }
+func _[T interface{ []byte | myByte1 | []int }] (x T, i, j, k int) { var _ T = x /* ERROR "no common underlying type" */ [i:j:k] }
func _[T interface{ []byte | myByte1 | myByte2 | string }] (x T, i, j, k int) { var _ T = x[i:j] }
func _[T interface{ []byte | myByte1 | myByte2 | string }] (x T, i, j, k int) { var _ T = x[i:j:k /* ERROR "3-index slice of string" */ ] }
-func _[T interface{ []byte | myByte1 | []int | string }] (x T, i, j, k int) { var _ T = x /* ERROR "no core type" */ [i:j] }
+func _[T interface{ []byte | myByte1 | []int | string }] (x T, i, j, k int) { var _ T = x /* ERROR "no common underlying type" */ [i:j] }
// len/cap built-ins