Should not wrap Type instances as TypeReference by default #845
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I couldn't find a reason why we would want to convert
Type
instances toTypeReference
instances unless it's explicit need for type construction (importNamespace
, explicitTypeReference.Create
). With this change can now read values likea.GetType().FullName
, earlier it was hidden asTypeRefereence
which doesn't expose much. Old behavior can still be achieved by engine type mappers / object converters.The README shows correct ways to achieve this:
But there's unit test cases that relies on auto-wrapping:
So I kept the auto-wrapping when called via
engine.SetValue(name, type)
, but no longer automatic inJsValue.FromObject
.fixes #533