You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From a dependent type perspective, a dyn can be seen as a dependent tuple.
Given a trait Foo, dyn Foo denotes an existentially quantified type: there exists a type that implements trait Foo.
Thus, an inhabitant of dyn Foo is simply a type T, a value of type T, and an impl of Foo for T. In other terms, dyn Foo is t: Type & t & foo t.
Note that Foo (and any trait, actually) should be implemented for such dependent tuples.
The text was updated successfully, but these errors were encountered:
From a dependent type perspective, a
dyn
can be seen as a dependent tuple.Given a trait
Foo
,dyn Foo
denotes an existentially quantified type: there exists a type that implements traitFoo
.Thus, an inhabitant of
dyn Foo
is simply a typeT
, a value of typeT
, and an impl ofFoo
forT
. In other terms,dyn Foo
ist: Type & t & foo t
.Note that
Foo
(and any trait, actually) should be implemented for such dependent tuples.The text was updated successfully, but these errors were encountered: