I mean, the type system isn’t very strict at all to begin with in some . It’s trivially breakable when performing common operations like type punning in C.
It was about 3 years ago, and I haven't been able to find my old code again. I probably discarded it after finding out it didn't work well. I was able to find this screenshot though:
Uh. Probably not exactly your case, but I managed to "reproduce" them.
The first case is easy if you just override the setter of a property, and is more a feature of the language rather than a bug.
The second case is more tricky, but by using a generic delegate you can manage to trick it by doing an unchecked cast. Got the same warning in IntelliJ as well.
12 Comments
henfredemars@infosec.pub · 17 pts · 1y
I mean, the type system isn’t very strict at all to begin with in some . It’s trivially breakable when performing common operations like type punning in C.
Korne127@lemmy.world · 13 pts · 1y
Depends on the programming language
GetOffMyLan@programming.dev · 3 pts · 1y
That's why we don't like c
onlinepersona@programming.dev · 8 pts · 1y
What did you actually do?
Anti Commercial-AI license
qaz@lemmy.world · 23 pts · 1y
I broke the type system in Kotlin and ended up with a null value in a non-null (not
lateinit) variable.zea_64@lemmy.blahaj.zone · 6 pts · 1y
How convoluted was it?
MMauro@feddit.it · 1 pts · 1y
With no platform types involved?
qaz@lemmy.world · 1 pts · 1y
Yes
MMauro@feddit.it · 1 pts · 1y
Interesting. Care to share? I think they fixed a few of those issues with K2. Did you find something new or is it known?
qaz@lemmy.world · 3 pts · 1y
It was about 3 years ago, and I haven't been able to find my old code again. I probably discarded it after finding out it didn't work well. I was able to find this screenshot though:
MMauro@feddit.it · 3 pts · 1y
Uh. Probably not exactly your case, but I managed to "reproduce" them.
The first case is easy if you just override the setter of a property, and is more a feature of the language rather than a bug.
The second case is more tricky, but by using a generic delegate you can manage to trick it by doing an unchecked cast. Got the same warning in IntelliJ as well.
Link: https://pl.kotl.in/pIt-uHw7d
kryllic@programming.dev · 2 pts · 1y
Heinz Doofenshmirtz as senior dev