Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
New test for null/nothing in assignments #1917
Browse files Browse the repository at this point in the history
  • Loading branch information
FroMage committed Nov 19, 2014
1 parent 8e756c3 commit 44a3fb2
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ void bug1917(){
variable Object a;
Integer b = a = 2;
a = 2;

variable String? head = null;
variable String? tail = null;
head = tail = null;
head = tail = nothing;
}

@noanno
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@ final class bug1917_ {
returning $ceylontmp$op$0;
).longValue();
a = .ceylon.language.Integer.instance(2L);
.ceylon.language.String head = null;
.ceylon.language.String tail = null;
head = (
let
{
.ceylon.language.String $ceylontmp$op$1 = null;
tail = $ceylontmp$op$1;
}
returning $ceylontmp$op$1;
);
head = (.ceylon.language.String)(
let
{
.java.lang.Object $ceylontmp$op$2 = .ceylon.language.nothing_.get_();
tail = (.ceylon.language.String)$ceylontmp$op$2;
}
returning $ceylontmp$op$2;
);
}

public static void main(.java.lang.String[] args) {
Expand All @@ -33,10 +51,10 @@ final class bug1917fails_ {
final Result x = (
let
{
Result $ceylontmp$op$1 = f.$call$();
memo = $ceylontmp$op$1;
Result $ceylontmp$op$3 = f.$call$();
memo = $ceylontmp$op$3;
}
returning $ceylontmp$op$1;
returning $ceylontmp$op$3;
);
}
}
Expand All @@ -50,10 +68,10 @@ final class bug1917works_ {
final Result x = (Result)(
let
{
Result $ceylontmp$op$2 = f.$call$();
memo = $ceylontmp$op$2;
Result $ceylontmp$op$4 = f.$call$();
memo = $ceylontmp$op$4;
}
returning $ceylontmp$op$2;
returning $ceylontmp$op$4;
);
}
}
Expand All @@ -77,10 +95,10 @@ class Bug1917Interop extends .com.redhat.ceylon.compiler.java.test.issues.bug19x
(
let
{
long $ceylontmp$op$3 = loginTimeout1;
setLoginTimeout(.com.redhat.ceylon.compiler.java.Util.toInt($ceylontmp$op$3));
long $ceylontmp$op$5 = loginTimeout1;
setLoginTimeout(.com.redhat.ceylon.compiler.java.Util.toInt($ceylontmp$op$5));
}
returning $ceylontmp$op$3;
returning $ceylontmp$op$5;
);
}

Expand All @@ -92,11 +110,11 @@ class Bug1917Interop extends .com.redhat.ceylon.compiler.java.test.issues.bug19x
(
let
{
.com.redhat.ceylon.compiler.java.test.issues.bug19xx.Bug1917Java $ceylontmp$opE$4 = getDataSource$priv$();
long $ceylontmp$opV$5 = loginTimeout2;
$ceylontmp$opE$4.setLoginTimeout(.com.redhat.ceylon.compiler.java.Util.toInt($ceylontmp$opV$5));
.com.redhat.ceylon.compiler.java.test.issues.bug19xx.Bug1917Java $ceylontmp$opE$6 = getDataSource$priv$();
long $ceylontmp$opV$7 = loginTimeout2;
$ceylontmp$opE$6.setLoginTimeout(.com.redhat.ceylon.compiler.java.Util.toInt($ceylontmp$opV$7));
}
returning $ceylontmp$opV$5;
returning $ceylontmp$opV$7;
);
}

Expand Down

0 comments on commit 44a3fb2

Please sign in to comment.