Log of the #nice channel on irc.freenode.net

* arjanb leaves02:41
* arjanb joins12:32
* rubber_duck joins16:53
Hi.
<arjanb>hi
<rubber_duck>I've got yet antoher problem I connot solve.
Be prepared for some lines of code:16:54
<arjanb>not to much at once because of floods
* GummiEnte joins16:55
Hello again.
Uups, now I'm double..
O, just try again:
interface A<T> {}16:56
class AImpl<T> implements A<T> {}
interface SA<T> extends A {
void foo((T, T) -> int);
}
class SAImpl<T> extends AImpl implements SA {
(T, T) -> int foo = ((T t1, T t2) => 0);
foo(f) = this.foo = f;
}
class Impl<T> extends SAImpl {}
class Foo<T> extends AImpl {
Impl<int> w = new Impl();
}
var Impl<int> v = new Impl();
What am I doing wrong here?
src/test3/test3.nice: line 12, column 19:16:57
Incorrect type in assignment to w
Found : <t0, T' | t0 <: T, T' < nice.lang.Maybe> test3.Impl<T'<t0>>
Expected: test3.Impl<nice.lang.int>
line 12 is the line in the class Foo<T>
not the line class Foo<T> but just the line below (sorry)
<arjanb>interface SA<T> extends A { should not compile16:58
<GummiEnte>It works. If you remove the variable declaration in the class Foo<T> it all compiles.
<arjanb>a moment i'm trying the code myself17:01
<GummiEnte>Ok, Thnx.
Well, you could even reduce it:17:02
interface A<T> {}
class AImpl<T> implements A<T> {}
interface SA<T> extends A {}
class SAImpl<T> extends AImpl implements SA {
(T, T) -> int foo = ((T t1, T t2) => 0);
}
class Impl<T> extends SAImpl {}
class Foo<T> extends AImpl {
Impl<int> w = new Impl();
}
var Impl<int> v = new Impl();
It will also compile if you remove the use of T in the SAImpl.17:03
<arjanb>one thing that makes no difference for the error but is wrong in your code17:04
<GummiEnte>Ohh, you could even reduce it more:17:05
interface A<T> {}
class AImpl<T> implements A {}
interface SA<T> extends A {}
class SAImpl<T> extends AImpl implements SA {
(T, T) -> int foo = ((T t1, T t2) => 0);
}
class Impl<T> extends SAImpl {}
class Foo<T> {
Impl<int> w = new Impl();
}
var Impl<int> v = new Impl();
Yes, please.
<arjanb>interface SA<T> extends A {} must be interface SA<T> extends A<T> {} they need the same number of type parameters17:06
<GummiEnte>Oh, I thought this would be automatically added.17:07
Ok, for the future I will add all the typevariables.17:08
What excaclty does " T' < nice.lang.Maybe" mean? 17:10
I've only found the meaning of "<:"17:11
* rubber_duck leaves
<GummiEnte>Oh, I'm gone :-)17:12
<arjanb>Maybe is the class that internally represents a thing a can be null
<GummiEnte>And what does that "<" mean?17:13
<arjanb>i think the same as "<"17:14
as "<:"
<GummiEnte>I've even reduced it further:
interface A<T> {}
interface SA<T> extends A<T> {}
class SAImpl<T> implements SA<T> {
(T, T) -> int foo = ((T t1, T t2) => 0);
}
class Impl<T> extends SAImpl<T> {}
class Foo<T> {17:15
Impl<int> w = new Impl();
}
var Impl<int> v = new Impl();
<arjanb>i think i have the minimal bug case now:
class Impl<T> {
T -> int bar = T t1 => 0;
}
class Foo<T> {
Impl<int> w = new Impl();
}
<GummiEnte>Yes!17:16
Do you think its a bug in the compiler or is in this code something conceptional wrong?17:17
<arjanb>this is a bug in the compiler
<GummiEnte>:-/17:19
<arjanb>i think the type variables get mixed up, if you leave <T> away from class Foo then there is no error
<GummiEnte>Yes.
Do you think, you can fix it?
I cannot do this. ;-)17:20
It's a bit to much for me and the nice compiler.
<arjanb>i can't either this is a type problem and the typesystem of nice is very complex17:21
<GummiEnte>Ok, then we will have to wait fro Daniel...
<arjanb>it's a strange bug this compiles:17:28
class Impl<T> {
T ?-> int bar = null;
}
class Foo<T> {
Impl<int> w = new Impl();
}
<GummiEnte>What is ?-> ?
Maybe null?17:29
<arjanb>yes
<GummiEnte>OK. I've got also another error message in the initial env. Let me see if I can get it.
The error message to the following is a bit different:17:37
class Impl<T> {
T -> int bar = T t1 => 0;
}
class Foo<T> {
//Impl<int> w = new Impl();
//Impl<A<int>> u = new Impl();
C<A<T>> t =new CImpl();
}
var Impl<int> v = new Impl();
var Impl<A<int>> u = new Impl();
interface A<T> {}
interface C<T> {}
class CImpl<T> extends Impl<T> implements C<T> {}
I've even got something more interesting:17:39
class Impl<T> {
T -> int bar = T t1 => 0;
}
var C<A<int>> u = new Impl();
interface A<T> {}
interface C<T> {}
class CImpl<T> extends Impl<T> implements C<T> {}
Typing error : test3.C<test3.A<nice.lang.int>> u cannot be assigned value new test3.Impl() of type <t1, T' | T' < nice.lang.Maybe> test3.Impl<T'<t1>> : 17:40
mlsub.typing.MonotypeLeqEx: test3.Impl<T'<t1>> <: test3.C<test3.A<nice.lang.int>> because of mlsub.typing.lowlevel.LowlevelRigidClash: Clash (test3.Impl[6]<:test3.C[9])
;-) I don't know anything anymore.
<arjanb>how did you get the last error?17:41
<GummiEnte>With the above code from "something more interesting:" onwards.17:42
Uups... I'm sorry. Forget the last error. It was, because I used: "var C<A<int>> u = new Impl();" instead of "var C<A<int>> u = new CImpl();"17:43
But as I said, the error differs from the "MaybeNull"-error, if you use the following:17:44
class Impl<T> {
T -> int bar = T t1 => 0;
}
class Foo<T> {
C<A<T>> t =new CImpl();
}
interface A<T> {}
interface C<T> {}
class CImpl<T> extends Impl<T> implements C<T> {}
Incorrect type in assignment to t17:45
Found : <t0, T' | t0 <: t1, T' < T'> test3.CImpl<T'<t0>>
Expected: test3.C<test3.A<T>>
So, maybe we have found two compiler bugs? Or do you think the first one is also reason for the second one?
<arjanb>i think both have the same cause17:46
but the second one is useful as additional testcase17:49
<GummiEnte>Good to hear that. btw. I'm using the released version 0.9.0.17:50
I would be proud, if I could say, that I completly understand what is going on in Nice/src/bossa/syntax/typecheck.nice...17:52
Do you think, Daniel will drop in here?17:56
<arjanb>that only a small part of it most of the typesystem is in mlsub.typing
<GummiEnte>I'm in this package already. But this is also not so clear for me. I think, one would need more then a few hours to understand how it is working.17:57
<arjanb>last weeks daniel comes only here in the evening
btw i have tried it with 0.8 at the same error occurs
<GummiEnte>and the most actually development version?17:58
<arjanb>yes idem
<GummiEnte>Ok. Then it will be something new for Daniel. I hope he likes tricky problems.18:01
I've got another interesting thing:18:04
Take the following method and the implemenations. Compile it.18:05
int getEEItem(char);
getEEItem(c) = 0;
getEEItem('(') = 2;
getEEItem('#') = 1;
In a package of your choice.
And then again compile it, but not with the -R switch, but simply with "nicec --sourcepath $src --destination $dest $package"
Normally this works perfectly. Then you will hopefully see also'18:06
test3: parsing
Pattern ' of method test3.getEEItem:(nice.lang.char)->nice.lang.int is not known
Then go ahead and do only resave the package file (not modify but simply resave). Then it will work again.18:07
Did you get the same effect?
If I remove the line (or comment out) "getEEItem('#') = 1;" everything works as expected.18:10
<arjanb>i can't compile using using sourcepath and destination i'm looking for another way to reproduce it18:15
the testcase of that type parameter bug is commit to cvs now18:18
<GummiEnte>I've just received the commit messae.18:23
<arjanb>and you have found a second bug today
<GummiEnte>The think with "getEEItem('#') = 1;"?!18:25
<arjanb>yes
<GummiEnte>So, if I found another one, what do I get?18:28
;-)
<arjanb>i found the problem # and @ are also used for type patterns18:37
<GummiEnte>And why it does compile when the files modification time is younger than the last generated classes?18:43
<arjanb>then it get automaticly recompiled 18:44
and on recompilation the bytecode attributes aren't read 18:46
it seems i need to add some more special case code19:00
<GummiEnte>Nice.19:17
<arjanb>problem is solved for in case of char literal patterns now i need to fix the same for strings19:23
<GummiEnte>Good news.19:24
I'll have to leave now. Hopefully Daniel will read the logs. Have a good evening. CU20:00
* GummiEnte leaves20:01

Generated by Sualtam