Join Slack
Powered by
guys, guys, a small question about generics: As fa...
# getting-started
e
evkaky
03/31/2017, 5:01 PM
guys, guys, a small question about generics: As far as I know, generic type <T> by default is a type of Any? (nullable Any). So, why I can't to do something like this:
Copy code
class MyClass<T> { var myVariable: T = null // compiler error }
?
2
Views
Open in Slack
Previous
Next