-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix java backend to generate valid code for empty structures.
Note that the additional test added indicates that neither the haskell backend nor the C++ backend get this right now. TODO: fix these.
- Loading branch information
Showing
6 changed files
with
140 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,10 @@ module test | |
|
||
// Simple structures | ||
|
||
struct S0 | ||
{ | ||
}; | ||
|
||
struct S1 | ||
{ | ||
Int32 x; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package adl.test; | ||
|
||
import org.adl.runtime.Factory; | ||
|
||
public class S0 { | ||
|
||
|
||
public S0() { | ||
} | ||
|
||
public S0(S0 other) { | ||
} | ||
|
||
public boolean equals(S0 other) { | ||
return true; | ||
} | ||
|
||
public int hashCode() { | ||
int result = 1; | ||
return result; | ||
} | ||
|
||
public static Factory<S0> factory = new Factory<S0>() { | ||
public S0 create() { | ||
return new S0(); | ||
} | ||
public S0 create(S0 other) { | ||
return new S0(other); | ||
} | ||
}; | ||
} |