diff options
| author | Cliff Click <cliffc@acm.org> | 2025-01-13 16:36:11 -0800 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2025-01-15 15:07:30 -0800 |
| commit | a0bee26d769adf61ed0a292983992a70e4e261c3 (patch) | |
| tree | 2b1a90d673ebb14492292f167011eb7a71facd47 /chapter18/src/test/java | |
| parent | c3559bb04362b948c390b35cac622ce61f494238 (diff) | |
| download | Simple-a0bee26d769adf61ed0a292983992a70e4e261c3.tar.gz Simple-a0bee26d769adf61ed0a292983992a70e4e261c3.zip | |
Prevent self-inlining
Better error message for self-calling functions
Diffstat (limited to 'chapter18/src/test/java')
| -rw-r--r-- | chapter18/src/test/java/com/seaofnodes/simple/Chapter18Test.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/chapter18/src/test/java/com/seaofnodes/simple/Chapter18Test.java b/chapter18/src/test/java/com/seaofnodes/simple/Chapter18Test.java index 0e92c8c0..1d7abde5 100644 --- a/chapter18/src/test/java/com/seaofnodes/simple/Chapter18Test.java +++ b/chapter18/src/test/java/com/seaofnodes/simple/Chapter18Test.java @@ -259,6 +259,18 @@ for(;;) { catch( Exception e ) { assertEquals("Accessing unknown field 'x' from '*S'",e.getMessage()); } } + @Test + public void testErr5() { + CodeGen code = new CodeGen( +""" +val g = { -> + g(); +}; +return 0; +"""); + try { code.parse().opto().typeCheck(); fail(); } + catch( Exception e ) { assertEquals("No defined return type",e.getMessage()); } + } // Mutual recursion. Fails without SCCP to lift the recursive return types. |
