File tree Expand file tree Collapse file tree 3 files changed +40
-7
lines changed
Expand file tree Collapse file tree 3 files changed +40
-7
lines changed Original file line number Diff line number Diff line change @@ -52,13 +52,13 @@ derive Show NIKind
5252{- -
5353 determine kind of java expression to generate, based on the item information
5454 -}
55- niKind " new" = NINew
56- niKind # ^\W +$# = NIOp
57- niKind #^\ w +$# = NIMethod
58- niKind # ^\.\ w +$# = NIMember
59- niKind # ^\(.+\) $# = NICast
60- niKind # .+\ [\ ]$# = NINewArray
61- niKind _ = NIStatic
55+ niKind " new" = NINew
56+ niKind ´ ^\W +$´ = NIOp
57+ niKind ´^ [ \ w \$ ] +$´ = NIMethod
58+ niKind ´ ^\.[ \ w \$ ] +$´ = NIMember
59+ niKind ´ ^\(.+\) $´ = NICast
60+ niKind ´ .+\ [\ ]$´ = NINewArray
61+ niKind _ = NIStatic
6262
6363{- -
6464 Check the sanity of the type of a native method, whose symbol is passed.
Original file line number Diff line number Diff line change 1+ package tests .comp ;
2+
3+ /**
4+ * <p>Test calss to demonstrate that $ in method names and member names work.</p>
5+ * @author ingo
6+ *
7+ */
8+ final public class I61Java {
9+ final public int mem$1 ;
10+ final public int $getMem1$ () { return mem$1 ;}
11+ public I61Java (int arg ) { mem$1 = arg ; }
12+ }
Original file line number Diff line number Diff line change 1+ --- 'https://github.com/Frege/frege/issues/61 Issue#61'
2+ {- -
3+ Compiler does not recognize instance methods and members
4+ that have a @$@ sign in their name.
5+ -}
6+ module tests.comp.Issue61 where
7+
8+
9+ data Native = pure native tests.comp.I61Java where
10+ pure native new :: Int -> Native
11+ pure native member " .mem$1" :: Native -> Int
12+ pure native method " $getMem1$" :: Native -> Int
13+
14+ main _ = do
15+ let nat = Native. new 42
16+ print " Member mem$1 is "
17+ println nat. member
18+ print " Method $getMem1$ returns "
19+ println nat. method
20+
21+
You can’t perform that action at this time.
0 commit comments