Class IVBInferableTypeExtensions
The candidate-type merge and resolution rules an IVBInferableType follows, per its own static-semantics note (IVBInferableType xmldoc remarks).
public static class IVBInferableTypeExtensions
- Inheritance
-
IVBInferableTypeExtensions
- Inherited Members
Methods
MergeCandidate(ImmutableHashSet<VBType>, VBType)
Adds vbType as a new candidate, applying the widening / merge rules a newly
found candidate goes through before joining the set.
public static ImmutableHashSet<VBType> MergeCandidate(this ImmutableHashSet<VBType> candidates, VBType vbType)
Parameters
candidatesImmutableHashSet<VBType>vbTypeVBType
Returns
Remarks
An integral candidate (IIntegralNumericType — Byte/Integer/
Long/LongLong) widens to VBLongType; a floating-point candidate
(IFloatingPointNumericType) widens to VBDoubleType; a fixed-point
candidate (IFixedPointNumericType) widens to VBCurrencyType — so
differently-sized numeric candidates bucket together instead of manufacturing spurious
conflicts. A candidate that is itself inferable contributes its own candidate set (already
widened) rather than joining as one opaque entry.
Resolve(IVBInferableType)
Resolves the single data type inferable's candidates currently agree on, or
null when they don't agree on one yet.
public static VBType? Resolve(this IVBInferableType inferable)
Parameters
inferableIVBInferableType
Returns
Remarks
A lone candidate resolves to itself. Two or more resolve to Variant when every candidate
is a plain value type (numeric, String, Boolean, …) — never when one of them is
Object or a class-ish type (IVBMemberOwnerType): those don't blend into a
Variant guess, and what they do resolve to isn't decided yet (the algorithm's
own doc trails into "TODO continue this" at exactly this point) — such a set currently resolves
to null, same as no candidates at all.