File tree Expand file tree Collapse file tree 5 files changed +40
-2
lines changed
Expand file tree Collapse file tree 5 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -7387,8 +7387,8 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
73877387 fmt.push_back (" %d" );
73887388 args.push_back (tmp);
73897389 } else {
7390- throw LCompilersException (" Printing support is not available for " +
7391- ASRUtils::type_to_str (t) + " type." );
7390+ throw CodeGenError (" Printing support is not available for ` " +
7391+ ASRUtils::type_to_str (t) + " ` type." , x. base . base . loc );
73927392 }
73937393 }
73947394 fmt.push_back (" %s" );
Original file line number Diff line number Diff line change 1+ from lpython import dataclass , i32
2+
3+ # test issue 2044
4+
5+ @dataclass
6+ class Foo :
7+ x : i32
8+
9+ @dataclass
10+ class Bar :
11+ foo : Foo = Foo ()
12+
13+ bar : Bar = Bar ()
14+
15+ print (bar .foo )
16+ print (bar )
Original file line number Diff line number Diff line change 1+ {
2+ "basename" : " llvm-structs_11-a746e1b" ,
3+ "cmd" : " lpython --no-color --show-llvm {infile} -o {outfile}" ,
4+ "infile" : " tests/errors/structs_11.py" ,
5+ "infile_hash" : " 9cb6c80ad837ba66472a91b22e9068ec439b6a2a179a452d90d84c78" ,
6+ "outfile" : null ,
7+ "outfile_hash" : null ,
8+ "stdout" : null ,
9+ "stdout_hash" : null ,
10+ "stderr" : " llvm-structs_11-a746e1b.stderr" ,
11+ "stderr_hash" : " 58e383d2ac915263088426f1b511760a8cb9ef3dd6f24cb207eda4de" ,
12+ "returncode" : 3
13+ }
Original file line number Diff line number Diff line change 1+ code generation error: Printing support is not available for `Foo` type.
2+ --> tests/errors/structs_11.py:16:1
3+ |
4+ 16 | print(bar)
5+ | ^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -687,6 +687,10 @@ asr = true
687687filename = " errors/structs_10.py"
688688asr = true
689689
690+ [[test ]]
691+ filename = " errors/structs_11.py"
692+ llvm = true
693+
690694[[test ]]
691695filename = " errors/const_01.py"
692696asr = true
You can’t perform that action at this time.
0 commit comments