Skip to content

Commit b0ee548

Browse files
committed
Completed major refactoring of type resolution, ensuring unambiguity, improving speed by order of magnitude
1 parent 47e2d4c commit b0ee548

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

proto/autotest/lib/equality_test.tx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ type GenTest<L,R> {
7777
Self.test_eq_val( left, same, diff );
7878
Self.test_eq_ref( left, same, diff );
7979
Self.test_eq_arr_cop( left, same, diff );
80-
## TODO: Comparison of arrays of references doesn't work well due to duplicate type specialization generation,
81-
## leading to is-a relationship test not always working.
82-
##Self.test_eq_arr_ref( left, same, diff );
80+
Self.test_eq_arr_ref( left, same, diff );
8381
}
8482
}
8583

proto/src/TODO.txt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,29 @@ Array object assignment, review and test semantics
127127

128128
Default initialization of array elements (at least if it's array of arrays)
129129

130+
Dynamic-length arrays tests - bounds checking, copying, etc - PARTIALLY DONE
131+
132+
Ensure VALUE type parameters are always correctly initialized
133+
134+
135+
136+
Ensure Ref<P> is-a Ref<Q> if P is-a Q
137+
138+
139+
140+
For VALUEs below a threshold (e.g. <= 4), coge-gen individual specializations for efficiency
141+
142+
143+
130144
Array initialization from sequence
131145
arr := []Int( seq ); ## of type Sequencable<Int>
132146
arr := [ seq... ];
133147
arr := [ 0..2... ];
134148

135149
Auto-conversion of array initialization elements (literals; also from sequences?)
136150

137-
Dynamic-length arrays tests - bounds checking, copying, etc - PARTIALLY DONE
138-
139151
Support negative array indexing from array end
140152

141-
Ensure VALUE type parameters are always correctly initialized
142-
143-
Ensure Ref<P> is-a Ref<O> if P is-a O
144-
145153

146154

147155
Ensure fields are always initialized (with the default constructor if no init expr provided)
@@ -156,8 +164,6 @@ Implement advanced implicit constructor concept
156164
Constructor initialization validation check: That each constructor properly initializes all members (without inlined initializers)
157165

158166

159-
For VALUEs below a threshold (e.g. <= 4), coge-gen individual specializations for efficiency
160-
161167

162168
Virtual dereferencing of abstract references for array subscripting, implicitly creating a reference to the element?
163169
r : &Array; s : &Array;

proto/src/driver.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,14 @@ void TxDriver::add_source_file( const TxIdentifier& moduleName, const std::strin
449449
}
450450

451451
int TxDriver::llvm_compile( const std::string& outputFileName ) {
452-
this->genContext->generate_runtime_type_info();
452+
try {
453+
this->genContext->generate_runtime_type_info();
454+
}
455+
catch ( const codecheck_error& err ) {
456+
LOG_DEBUG( (&_LOG), "Caught code check error generating runtime type info: " << err );
457+
return 1;
458+
}
459+
453460
this->genContext->declare_builtin_code();
454461

455462
int codegen_errors = 0;

0 commit comments

Comments
 (0)