diff options
| author | Cliff Click <cliffc@acm.org> | 2026-08-10 11:11:18 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-10-24 15:56:44 -0700 |
| commit | ecd82ce8ebbefef223cd934cd87802f4d03c1867 (patch) | |
| tree | d7cb8e837ec90a646c0b6e15dcb93dea6b10ffd3 /src/test/java/com/seaofnodes/simple/Chapter17bTest.java | |
| parent | f5f0580331b4e29a0a0dc43d9885dfe0f0aed865 (diff) | |
| download | Simple-linear-chapter26.tar.gz Simple-linear-chapter26.zip | |
Chapter 26: Construction and Private Memorylinear-chapter26
Co-authored-by: Hsiang-Ying Fu <66062782+fuhsnn@users.noreply.github.com>
Co-authored-by: fuhsnn <66062782+fuhsnn@users.noreply.github.com>
Co-authored-by: Symious <14933944+symious@users.noreply.github.com>
Co-authored-by: Jun Kawasaki <jun784@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/test/java/com/seaofnodes/simple/Chapter17bTest.java')
| -rw-r--r-- | src/test/java/com/seaofnodes/simple/Chapter17bTest.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/java/com/seaofnodes/simple/Chapter17bTest.java b/src/test/java/com/seaofnodes/simple/Chapter17bTest.java index d2fa40f3..3fbf0daa 100644 --- a/src/test/java/com/seaofnodes/simple/Chapter17bTest.java +++ b/src/test/java/com/seaofnodes/simple/Chapter17bTest.java @@ -289,7 +289,7 @@ A x = new A { b = new B; }; """); - try { code.driver(CodeGen.Phase.FinalizeIR); fail(); } + try { code.driver(CodeGen.Phase.TypeCheck); fail(); } catch( Exception e ) { assertEquals("Cannot read uninitialized field 'b'",e.getMessage()); } } @@ -302,7 +302,7 @@ return new A { if (arg) b = new B; // Constructor ends with partial init of b }.b; """); - try { code.parse(); fail(); } + try { code.driver(CodeGen.Phase.TypeCheck); fail(); } catch( Exception e ) { assertEquals("'A' is not fully initialized, field 'b' needs to be set in a constructor",e.getMessage()); } } |
