digitalmars.D.learn - Can't "is null" an interface?!?! Incompatible types???
- Nick Sabalausky (Abscissa) (24/24) Mar 07 2018 ---------------------
- Nicholas Wilson (16/41) Mar 07 2018 That does seem odd.
- Nick Sabalausky (Abscissa) (5/21) Mar 08 2018 Interesting. I was using vibe.d 'v0.8.3-rc.1' (which doesn't appear to
- Nick Sabalausky (Abscissa) (2/8) Mar 08 2018 https://github.com/vibe-d/vibe.d/issues/2108
- Jacob Carlborg (8/12) Mar 08 2018 It's a struct in "v0.8.3-rc.1" [1]. In "v0.8.3-rc.1" the new
---------------------
import vibe.core.net;
TCPConnection mySocket;
void main() {
auto b = mySocket is null;
}
---------------------
That's giving me:
---------------------
Error: incompatible types for (mySocket) is (null): TCPConnection and
typeof(null)
---------------------
WTF?!?!
The type in question (vibe.core.net.TCPConnection) is an interface:
http://vibed.org/api/vibe.core.net/TCPConnection
https://github.com/vibe-d/vibe.d/blob/master/core/vibe/core/net.d#L344
The following works just fine:
---------------------
interface IFoo {}
void main() {
IFoo i;
auto b = i is null;
}
---------------------
Mar 07 2018
On Thursday, 8 March 2018 at 04:48:08 UTC, Nick Sabalausky
(Abscissa) wrote:
---------------------
import vibe.core.net;
TCPConnection mySocket;
void main() {
auto b = mySocket is null;
}
---------------------
That's giving me:
---------------------
Error: incompatible types for (mySocket) is (null):
TCPConnection and typeof(null)
---------------------
WTF?!?!
The type in question (vibe.core.net.TCPConnection) is an
interface:
http://vibed.org/api/vibe.core.net/TCPConnection
https://github.com/vibe-d/vibe.d/blob/master/core/vibe/core/net.d#L344
The following works just fine:
---------------------
interface IFoo {}
void main() {
IFoo i;
auto b = i is null;
}
---------------------
That does seem odd.
---
/+dub.sdl:
dependency "vibe-d" version="~>0.8.3-alpha.1"
+/
import vibe.core.net;
import std.stdio;
TCPConnection mySocket;
void main() {
auto b = mySocket is null;
writeln(b);
}
---
works fine on run.dlang.io
Mar 07 2018
On 03/08/2018 01:13 AM, Nicholas Wilson wrote:
That does seem odd.
---
/+dub.sdl:
dependency "vibe-d" version="~>0.8.3-alpha.1"
+/
import vibe.core.net;
import std.stdio;
TCPConnection mySocket;
void main() {
auto b = mySocket is null;
writeln(b);
}
---
works fine on run.dlang.io
Interesting. I was using vibe.d 'v0.8.3-rc.1' (which doesn't appear to
work on run.dlang.io). But it does seem to work for me if I use
'v0.8.3-alpha.1'.
I wonder what could have changed to result in this?
Mar 08 2018
On 03/08/2018 03:04 AM, Nick Sabalausky (Abscissa) wrote:Interesting. I was using vibe.d 'v0.8.3-rc.1' (which doesn't appear to work on run.dlang.io). But it does seem to work for me if I use 'v0.8.3-alpha.1'. I wonder what could have changed to result in this?https://github.com/vibe-d/vibe.d/issues/2108
Mar 08 2018
On Thursday, 8 March 2018 at 08:04:54 UTC, Nick Sabalausky (Abscissa) wrote:Interesting. I was using vibe.d 'v0.8.3-rc.1' (which doesn't appear to work on run.dlang.io). But it does seem to work for me if I use 'v0.8.3-alpha.1'. I wonder what could have changed to result in this?It's a struct in "v0.8.3-rc.1" [1]. In "v0.8.3-rc.1" the new vibe-core package is the default configuration. [1] https://github.com/vibe-d/vibe-core/blob/master/source/vibe/core/net.d#L467 -- /Jacob Carlborg
Mar 08 2018









"Nick Sabalausky (Abscissa)" <SeeWebsiteToContactMe semitwist.com> 