That say it seems that I found a bug in type checking (1.1.1) (Perhaps on current development it works), thats's why I don't post :
I tried to works with my own typechecking understandings as Anything(Nothing*) as a subtype, I tried to work on supertype.
Therefore I check my comprehension of the different equally forms of function type with one or two parameters.
Then I figure out that for their supertype I can only works on enumerated cases, so I tried this :
alias OneParam => Anything(Nothing);
alias TwoParam => Anything(Nothing, Nothing);
alias OneOrTwoParam => OneParam|TwoParam;
alias OneOrTwoParamb => Callable<Anything, Tuple<Nothing, Nothing, []&[Nothing]>>;
alias OneOrTwoParamc => Callable<Anything, [Nothing] & [Nothing, Nothing]>;
OneOrTwoParam f1o2 = (Integer x, Integer y) => x+y;
OneOrTwoParamb f1o2b = f1o2;
OneOrTwoParamc f1o2c = f1o2b;
OneOrTwoParam f1o2d = f1o2b; // Specified expression must be assignable to declared type of f1o2d: OneOrTwoParamb (Callable<Anything,Tuple<Nothing,Nothing,Nothing>>) is not assignable to OneOrTwoParam (Anything(Nothing)|Anything(Nothing, Nothing))
OneOrTwoParamb f1o2e = f1o2c; // Specified expression must be assignable to declared type of f1o2e: OneOrTwoParamc (Anything(*Nothing)) is not assignable to OneOrTwoParamb (Callable<Anything,Tuple<Nothing,Nothing,Nothing>>)
Callable<Anything, [Nothing] & [Nothing, Nothing]> f1o2f = f1o2;
print(f1o2);
print(f1o2b);
print(f1o2c);
print(f1o2d);
print(f1o2e);
curry(f1o2); //Argument must be assignable to parameter f of curry: OneOrTwoParam (Anything(Nothing)|Anything(Nothing, Nothing)) is not assignable to Anything(Nothing, Nothing=)
curry(f1o2b);
curry(f1o2c); //Argument must be assignable to parameter f of curry: OneOrTwoParamc (Anything(*Nothing)) is not assignable to Anything(Anything, Anything*)
curry(f1o2e);
curry(f1o2f); //The ExpressionVisitor caused an exception visiting a InvocationExpression node: "java.lang.UnsupportedOperationException" at com.redhat.ceylon.model.typechecker.model.NothingType.collectSupertypeDeclarations(NothingType.java:25)
Anything(Nothing, Nothing*)
(which are in fact Anything(Nothing)|Anything(Nothing, Nothing)|Anything(Nothing, Nothing, Nothing)|...)Is it Anything(Nothing, *Nothing) ? I didn't find where spread operator could be used for type (by reading it, I don't understand difference with undetermined number of parameters).
--
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users...@googlegroups.com.
To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at http://groups.google.com/group/ceylon-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/CAP7PoCdjvVM3euiLsbhmqxtu2LyNXcr%2BGygocSF3wM1MVKX4VQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users...@googlegroups.com.
To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at http://groups.google.com/group/ceylon-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/CAP7PoCfFy02N30t%2B_7MsaZ%3DYdt%2BUEYQ3yb87X46%2Bj868U5knNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/CAKU9E9sjdJh_r94T%3DOhcDMQ-gbXGq8vE%3DnfBGHj7ys6m8vDt_Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/55B22E8B.5010308%40googlemail.com.
--
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users...@googlegroups.com.
To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at http://groups.google.com/group/ceylon-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/CAP7PoCe_uXw-32zU2VGwGRxKB4xYs4dgL3OK8E67px7GRwzO_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/CAP7PoCeOhUHe4xSKB-REP%3DPTQq3P%2B4-LUDN%3DFdNhhWwOdZdPew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/CAP7PoCeY9Kmkad4sGMvZhDqw0AimeqZf6dP_0crOpscx1yAgMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
On Fri, Jul 24, 2015 at 1:55 PM, 'vincent beauseigneur' via
ceylon-users <ceylon...@googlegroups.com> wrote:
> Saying that Anything(Nothing) and Anything(Nothing, Nothing) are the same as
> Anything(Nothing*) implies :
No, that's not right. Anything() means Callable<Anything,Empty> which
is not a supertype of Callable<Anything,Nothing>.
--
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users...@googlegroups.com.
To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at http://groups.google.com/group/ceylon-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/78c9fcb3-4100-408d-8707-47f3c58b148d%40googlegroups.com.
In the way, I was so concentrate on the canonical form that I lost that [] & [Integer] is Nothing.(you cannot have [] in an [Integer] variable)