Fix crash during user_defined_conversions_2
Temporaries created during user conversion operations were being dropped before the result of the conversion was able to be used. This fixes that by temporarily storing the result of the conversion inside the current Function_Push_Pop context.
This commit is contained in:
@@ -5,6 +5,23 @@ auto t := TestBaseType();
|
||||
// This uses the TestBaseType to Type2 user type
|
||||
// conversion which was added in the module and then calls
|
||||
// "get_val()" which exists on the Type2 type
|
||||
assert_equal(t.get_val(), 10);
|
||||
//assert_equal(t.get_val(), 10);
|
||||
//print("Made it past test 1");
|
||||
|
||||
var t2 := Type2(t);
|
||||
var str = string(get_str(t2));
|
||||
|
||||
assert_equal("Hello World", str);
|
||||
print("Made it past test 2");
|
||||
|
||||
assert_equal(11, size(get_str(t2)));
|
||||
print("Made it past test 3");
|
||||
|
||||
|
||||
assert_equal(11, t2.get_str().size());
|
||||
print("Made it past test 4");
|
||||
|
||||
assert_equal(11, t.get_str().size());
|
||||
print("Made it past test 5");
|
||||
|
||||
|
||||
assert_equal(t.get_str().size(), 11);
|
||||
|
Reference in New Issue
Block a user