In most cases, when you want to make sure that A <:< B(or, rather, you want to make sure that you are A <: Busing type proof A <:< B), this is because in fact you have a type value Aand want to be able to treat it as an instance of the type B.
x: A, , A B, x B.
<:< , , ( , ).
, A <:< B, , , A B ( x:A B).
, , , , <:< Function1 .
=:=.
UPDATE: " =: =, A A?":
, <:< : , A <: B, A B ( ).
, :
class Foo {
def hello() { println("hello!") }
}
def f[T]( value: T )(implicit e: T <:< Foo){
value.hello()
}
class Bar extends Foo
f( new Bar )
f , value T.
, T Foo.
, , e: T <:< Foo T Foo,
value.hello() , T - ,
- .
e: T <:< Foo , T <: Foo.
, T Foo .
, T Foo, T <:< Foo.
, =:=: T =:= Foo
T = Foo, .