This is because compiler allows this and implicitly uses any as a default type-argument. This is however lead to a non-obvious bug that lock1 -> handler connection is allowed even though T and stream<T> cannot be same thing... Right? Well, turns out they can if T is any!
stream<any> :> any
Proposal
Get rid of this feature and enforce explicit type-arguments. Implicit any is basically type inference of smoker. Unless we heave real type-inference we must not make assumptions
Problem
Let's first look at this
Main
component and specifically on howFor
is usedAs we can see it used without type-arguments even though it has one type-parameter
This is because compiler allows this and implicitly uses
any
as a default type-argument. This is however lead to a non-obvious bug thatlock1 -> handler
connection is allowed even thoughT
andstream<T>
cannot be same thing... Right? Well, turns out they can ifT
isany
!Proposal
Get rid of this feature and enforce explicit type-arguments. Implicit
any
is basically type inference of smoker. Unless we heave real type-inference we must not make assumptions