jemc changed the topic of #ponylang to: Welcome! Please check out our Code of Conduct => https://github.com/ponylang/ponyc/blob/master/CODE_OF_CONDUCT.md | Public IRC logs are available => http://irclog.whitequark.org/ponylang | Please consider participating in our mailing lists => https://pony.groups.io/g/pony
Matthias247 has quit [Read error: Connection reset by peer]
jemc_ has quit [Ping timeout: 246 seconds]
unbalanced has joined #ponylang
jemc_ has joined #ponylang
unbalanced has quit [Ping timeout: 268 seconds]
irx[m] has joined #ponylang
jemc_ has quit [Ping timeout: 256 seconds]
srenatus[m] has joined #ponylang
M-hrjet has joined #ponylang
M-Ingo has joined #ponylang
prose[m] has joined #ponylang
buchanon[m] has joined #ponylang
AwesomeBrony has joined #ponylang
<AwesomeBrony> Hello
AwesomeBrony has quit [Client Quit]
c355e3b has quit [Quit: Connection closed for inactivity]
rurban has joined #ponylang
rurban has quit [Ping timeout: 265 seconds]
rurban has joined #ponylang
graaff has joined #ponylang
Matthias247 has joined #ponylang
mrkishi has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ponylang
rurban has left #ponylang [#ponylang]
c355e3b has joined #ponylang
Matthias247 has quit [Read error: Connection reset by peer]
unbalanced has joined #ponylang
unbalanced has quit [Ping timeout: 264 seconds]
rurban has joined #ponylang
rurban1 has joined #ponylang
rurban has quit [Ping timeout: 260 seconds]
mrkishi has joined #ponylang
jemc_ has joined #ponylang
TonyLo has joined #ponylang
btab has joined #ponylang
jemc_ has quit [Ping timeout: 250 seconds]
<btab> Heya - could someone take a quick look at https://gist.github.com/btab/1d814e886e9216c26cf0be485c1a0f5d and let me know what I'm missing? I don't understand how to address the compile errors.
TonyLo has quit [Read error: Connection reset by peer]
btab has quit [Ping timeout: 260 seconds]
jemc_ has joined #ponylang
jemc_ has quit [Ping timeout: 245 seconds]
Matthias247 has joined #ponylang
theodus has joined #ponylang
btab has joined #ponylang
<theodus> Hey btab, I'm getting the same errors. This seems to be a bug in the compiler because it is saying that "ref is not a subtype of #read" even though it is.
<theodus> The same goes for val.
<btab> Oh good - I'm not going crazy :-)
<btab> I'm happy to raise an issue but could use some help checking this won't be a dupe of an existing one - not quite sure what to look for.
<theodus> I think this is another example of the issues with subtype checking shown in issues 1193, 1328, and 1393. I'm not positive if it's the same issue though it seems to be related.
mrkishi has quit [Remote host closed the connection]
graaff has quit [Quit: Leaving]
<btab> OK I think I have another one. Can someone take a look at this: https://gist.github.com/btab/a9c63828cbc3858f7a350faa8c02c974 ?
<btab> I may just have misunderstand how the various refcap defaults are meant to act in these cases - but it's not doing what I expect.
rurban has joined #ponylang
rurban2 has joined #ponylang
<doublec> btab: that's odd - it seems to be treating the default rcap for a class as iso
rurban1 has quit [Ping timeout: 265 seconds]
<doublec> btab: but it should be ref
rurban has quit [Ping timeout: 268 seconds]
<doublec> btab: if you give Foo a constructor it works
<doublec> maybe the default constructor for a class is "new iso create"
<doublec> btab: if that's the case you cn just declare the type: let f1: Foo = Foo
<doublec> btab: or consume it: useFoo(consume f1)
<btab> Yeah - there are a few ways to overcome it (I'm favoring the approach shown in 'f2' - declare the type explicitly). So if you're right about the default constructor type, that means that supplying the type explicitly on the LHS of the let expression isn't just saying 'give me a Foo' but actually saying 'give me a Foo ref' (and so coercing the iso to a ref).
<btab> Easy to work around - but again not what I was expecting :-)
<doublec> btab: yes, the default cap for a class is 'ref', so "let x: Foo" is "let x: Foo ref". And automatic recovery is converting the iso to a ref in that case.
<btab> Oh because classes can have constructors with different refcaps to their own. So let x = Foo reads 'declare x and make it the type of Foo.create()' per the sugaring for constructors. Whereas let x:Foo = Foo reads 'declare x and make it the type of class Foo - and then do your best to make the RHS match this'.
<btab> Is that right?
<btab> So I guess the only thing I need a better understanding of is why the default constructor returns an iso when an explicit constructor has a default refcap of ref. Any thoughts on that?
<doublec> btab: yes
<doublec> btab: Although "let x = Foo" is more "declare x and infer the type from the right hand side, and the RHS is a constructor so use the rcap of that"
<btab> Ah sorry - yeah that's what I meant.
<doublec> btab: I don't know what the default constructor is an iso - one of the language devs might be able to comment further on that
<doublec> d/what/why/
<doublec> s/d/s/
<doublec> Bad keyboard day :)
btab has quit [Ping timeout: 260 seconds]
theodus has quit [Quit: Page closed]
rurban2 has left #ponylang [#ponylang]
[CBR]Unspoken has quit [Ping timeout: 268 seconds]