SpacemanDMM
SpacemanDMM copied to clipboard
Sleep detection does not catch some child overrides.
The following example does not detect any issues (v0.1.10 VSCode extension):
/proc/foo()
set SpacemanDMM_should_not_sleep = TRUE
var/test/test = new /test/sub()
test.baz()
/test/proc/baz()
/test/sub/baz()
bar()
/test/proc/bar()
sleep(1)
It seems this should have been fixed in #214, but the example suggests some cases are missed. The simpler
/proc/foo()
set SpacemanDMM_should_not_sleep = TRUE
var/test/test = new /test/sub()
test.baz()
/test/proc/baz()
/test/sub/baz()
sleep(1)
does detect the sleep.
@afterthought2 this happens because you are make a /test/sub but storing it in a /test typed var, it's a limitation I keep trying to overcome but it's incredibly complicated to do static analysis of types
The places where this comes up involve things like
/foo
var/path // subtype of bar
/foo/proc/make()
var/bar/bar = new path()
where it's not possible to fully type the var. I realize that performing static analysis that fully accounts for all possibilities here is difficult/expensive, but if it becomes possible it would be very useful for us.
It won't be possible unless someone smarter than me can figure out how to do that kind of very advanced static analysis