Changes between Initial Version and Version 1 of Ticket #189
- Timestamp:
- Jul 3, 2020, 2:25:52 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #189
-
Property
Summary
changed from
Reference types allow unsound assignment
toReference and pointer types allow unsound initialization
-
Property
Summary
changed from
-
Ticket #189 – Description
initial v1 32 32 33 33 Actual: Compiler success; program prints 1078523331. 34 35 This behaviour also occurs with pointers. Furthermore, this example is trimmed such that it can run with -n (no prelude). 36 37 {{{ 38 struct A {}; 39 struct B {}; 40 41 void f() { 42 A * ap; 43 B * bp = ap; // not sound 44 } 45 }}} 46 47 Expected: Compiler error at "not sound" line, saying cannot initialize B* from A*. 48 49 Actual: `cfa-cpp -n -P astexpr -P ascodegen` produces output in which the "unsound" line is `B *_X2bpPS1B_2 = ((B *)_X2apPS1A_2);`.