AndrolGenhald

Results 137 comments of AndrolGenhald

I also noticed what is probably a bug with unix-read.js: ``` const bytesRead = await readAsync(this.fd, buffer, offset, length, null) if (bytesRead === 0) { return this.read(buffer, offset, length) }...

It shouldn't crash like that, but intersecting two classes doesn't make much sense anyway. Either we already know one class extends the other, or we know they can't possibly intersect....

> Either the mock object already implement the interface and it should already work or it doesn't and it's weird Intersecting objects and interfaces makes sense when the class is...

@orklah Given that [docblock types](https://psalm.dev/r/39c247533a) work I'd take a look at the PR that added support for intersection signature types, maybe there's something happening during scanning that needs to happen...

Probably related: #8387, I think we need to move some of the intersection stuff to the analysis phase instead of the scanning phase, but I'm not sure how much work...

Thanks for the reproducer, that backtrace should be helpful.

I don't think this is really the intent of assertions. A function asserting something should check that that thing is true. For this to be safe Psalm would need to...

[Should it](https://3v4l.org/WMpWd)? We could probably make it conditional on `$needle` being non-empty though.

> It's not possible to make conditional assertions though Almost works: https://psalm.dev/r/b00677937e Just depends on #7096. I think it might be preferable to just fix #7096 first and do it...

> Oh, I didn't remember we could do that! I was actually not really sure myself until I tried it :laughing: