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:
Jason Turner
2014-11-02 21:37:01 -07:00
parent 20c0e6016e
commit c876a89030
7 changed files with 103 additions and 8 deletions

View File

@@ -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);