1 // errchk $G -e $D/$F.go
3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Test that basic operations on named types are valid
8 // and preserve the type.
23 func asString(String) {}
40 asBool(1 != 2) // ERROR "cannot use.*type bool.*as type Bool"
41 asBool(i < j) // ERROR "cannot use.*type bool.*as type Bool"
43 _, b = m[2] // ERROR "cannot .* bool.*type Bool"
46 _, b = inter.(Map) // ERROR "cannot .* bool.*type Bool"
49 var minter interface {
52 _, b = minter.(Map) // ERROR "cannot .* bool.*type Bool"
56 asBool(bb) // ERROR "cannot use.*type bool.*as type Bool"
57 _, b = <-c // ERROR "cannot .* bool.*type Bool"
60 asString(String(slice)) // ok