-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
40 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package tests.comp; | ||
|
||
/** | ||
* <p>Test calss to demonstrate that $ in method names and member names work.</p> | ||
* @author ingo | ||
* | ||
*/ | ||
final public class I61Java { | ||
final public int mem$1; | ||
final public int $getMem1$() { return mem$1;} | ||
public I61Java(int arg) { mem$1 = arg; } | ||
} |
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,21 @@ | ||
--- 'https://github.com/Frege/frege/issues/61 Issue#61' | ||
{-- | ||
Compiler does not recognize instance methods and members | ||
that have a @$@ sign in their name. | ||
-} | ||
module tests.comp.Issue61 where | ||
|
||
|
||
data Native = pure native tests.comp.I61Java where | ||
pure native new :: Int -> Native | ||
pure native member ".mem$1" :: Native -> Int | ||
pure native method "$getMem1$" :: Native -> Int | ||
|
||
main _ = do | ||
let nat = Native.new 42 | ||
print "Member mem$1 is " | ||
println nat.member | ||
print "Method $getMem1$ returns " | ||
println nat.method | ||
|
||
|