« first day (1687 days earlier)      last day (1493 days later) » 
00:00 - 16:0016:00 - 00:00

12:00 AM
RELOAD!
[rubberduck-vba/Rubberduck] 6 commits. 3 opened issues. 13 closed issues. 27 issue comments. 1394 additions. 964 deletions.
 
Just wanna say, I am truly thankful for the long-suffering folks in the VBA community on @StackCodeReview You're some real heroes, and an awful lotta folks have benefited from your work and patient help. Please don't let the haters get you down!
3
 
@Comintern just a reminder - I would like your ideas on handling the "SL" issue with objects in the Main project on the mocking PR
 
SL?
 
Service Locator, I think
 
^
well more like bastardized singletons
 
12:20 AM
Ah. For some reason I read that as SLL, and was like, wait...parser?
 
they are not in SL (yet) -- one such thing would be VbeProvider
which I just realized this morning isn't really an anti-pattern
(at least not according to Mark -- his idea of SL means that it has a dictionary of Types, which isn't what the VbeProvider is doing ATM.
 
@Comintern Thanks for the class design review answer!
 
I really think the VBE should be treated as a service more not less. We do live there, right?
 
ServiceLocators are mapping types to instances
 
Since I'm adding more COM-visible objects, figure best to have a system of how we will make it DI & UT friendly
 
12:22 AM
@Phrancis NP. Hope that made sense.
 
Yeah. With VbeProvider we just have a static method that fills in the instances and use it as a singleton.
 
@Comintern Yeah your approach seems way more solid than that requested by the exercise
 
@Vogel612 In the strictest of senses, that's what we'd do if we were returning an IVbe.
 
I don't follow.
 
I also know that singletons outside the DI/IOC can be problematic so want to be sure I avoid the pitfalls as much as we can.
 
12:23 AM
Probably because I'm dead tired by now :(
 
A VBE locator returns either a VBA or VB6 typed VBE.
 
I think that's actually different service.
^ that's what get us the correct VBE
with VbeProvider, the main purpose is to give COM-visible objects access to the VBE without DI'ing it.
 
TTGTB. Toodles!
 
bye!
 
I can see that. I'm really not much on the SL pattern hating. It imposes a DI pattern preference at the detriment of what makes sense. DI doesn't need to mean DI all the time and nothing but DI. That got us in trouble in some places in the past.
'night.
 
12:26 AM
Yeah, it's not the worst pattern to have. It's more that I feel that I'm doing this in an ad hoc fashion lately
with the 2 new services I added for mocking PR, I made them singleton.
Actually TypeLibQueryService really doesn't have to be singleton...
But currently the classes are using static methods Instance to get the instance, and that can be problematic for UT.
 
There's simply some realities that using DI where it counts implies - and one of those realities is that you can KISS in some places by using an SL pattern.
 
So I'm thinking of abstracting it one more out... maybe expand the VbeProvider to provide those.
 
Are the statics using anything that is problematic for UT?
 
(though if I do that, it's no longer just "Vbe" provider)
NAFAIK.
 
GodProvider?
 
12:29 AM
with CachedTypeService, it must have static members or everything will go to hell
lol
because types are supposed to be same
with TypeLibQueryService.... like I said before, I really didn't have to make it singleton, so I guess that was a bit silly on my part.
 
Right. Has anyone done a thread safety review of the statics? That would be my bigger concern.
 
Oh, wait, I think I know why. It'd have to be new'd up inside the mock provider
and that can be badâ„¢ for unit testing the mock provider.
I don't think so.
 
Or is the assumption that these would be used only from an STA thread?
 
Well, they have COM stuff so they almost have to be single-threaded and on UI thread but no reason to naively assume that it'll always be the case.
 
I'm trying to remember how that breaks down at the interop boundary.
 
12:32 AM
those 2 services don't go across the boundary
they're basically just helpers that is ultimately used by the MockProvider (which do go over the boundary)
 
IIR, it mainly means that the requests get queued, but once they cross the managed boundary, you can thread them as freely as you want.
I wonder how the broken type equivalence effects concurrent cache containers?
Should be fine as long as the keys have equivalency I guess.
 
I'm using the concurrentdictionary to cache the types
yeah, the hard part is keeping the progid straight
 
Right. Is that guaranteed to be unique?
 
don't care
 
I.e., in theory, you could be using 2 different versions of the same progid in the same program.
 
12:36 AM
first one in wins
we then are stuck with that first type for the session lifetime
 
Works for me.
 
not sure if I need to care about version. Need a MCVE demonstrating this to be a problem.
Because IINM, you can't have multiple versions in VBA.
 
@this Challenge accepted!
:joke:
 
Note that there's a TryAddTypeInternal that has a ref Type type parameter so if we find a 2nd type for same progid, that will get replaced.
LOL
 
That's actually pretty clever. It would function like a partially mutable hashset.
 
12:43 AM
right. methods that can return a Type based on COM objects are now encapuslated in that service
so we avoid the risk of getting 2 types that's "equivalent" and faceplanting on a invalid cast exception
 
Speaking of which, is your issue out of triage yet?
 
don't think so
from a commenter on GH, he didn't give me much hope that it'll be fixed ever.
 
Just a wild guess, but I don't think anyone envisioned our use case.
 
TBH, it seems exactly what Type.IsEquvialentTo was for....
I mean, for crying out loud, their stinking article even describe it so!
 
IKR?
 
12:46 AM
but yeah you're probably right.
They're probably all going "wtf is this guy yammering on? Mocking COM? Why would he want to do that?"
nah, not even that.
more like "meh, don't care"
 
I thought it would be more like "Mocking COM? I thought everyone mocked it."
 
lol
 
1:35 AM
Just wanna say, I am truly thankful for the long-suffering folks in the VBA community on @StackCodeReview You're some real heroes, and an awful lotta folks have benefited from your work and patient help. Please don't let the haters get you down!
 
this makes me want to cry:
        public bool TryGetProgIdFromComType(Type comObjectType, out string progId)
        {
            var pTi = Marshal.GetITypeInfoForType(comObjectType);
            if (pTi != IntPtr.Zero)
            {
                var clsid = Guid.Empty;
                using (DisposalActionContainer.Create(pTi, x => Marshal.Release(x)))
                {
                    var typeInfo = (ITypeInfo) Marshal.GetTypedObjectForIUnknown(pTi, typeof(ITypeInfo));
                    typeInfo.GetTypeAttr(out var pAttr);
#SomeRefactoringRequired
 
:widens browser window:
 
2:03 AM
Is that part of the RD code base?
 
not yet
gonna love how typelib API makes it very easy to ascend.
(clarify i'm not referring to Wayne's API but the standard typelib API)
 
 
1 hour later…
3:22 AM
probably a marginal improvement....
        private bool TryFindCoClass(ITypeLib lib, int originatingIndex, string originatingName, Guid originatingGuid, out ITypeInfo coClass)
        {
            ITypeInfo coClassTypeInfo = null;
            EnumerateTypeInfos(lib, i =>
            {
                if (i == originatingIndex)
                {
                    return false; //No point in asking if one is oneself's parent...
                }

                lib.GetTypeInfo(i, out var otherTypeInfo);
                UsingTypeAttr(otherTypeInfo, otherAttr =>
 
That makes me a little cross-eyed.
 
yeah. The TypeInfo API is very fun.
 
Not quite the same code arrow, but the nested invocations and function parameters aren't as readable IMHO. There isn't a way to make it more fluent is there?
 
hmm.
probably not without more work.
 
The disposables make that stupid difficult.
 
3:32 AM
yeah - it's primarily there to ensure that we don't leak pointers.
 
Oh sure - it just dictates structure to an annoying degree.
 
IKR?
I'm kind of thinking that maybe it's wrong -
if all the Marshal.PtrToStructure<> is copy data, then we can release the struct right after.
 
I'm not sure how much more performant this is than just tossing it through the ComProject ctor and seeing what it spits out.
 
no need to nest the operations in it.
The intention was to work with an arbitrary starting point (e.g. given a ITypeInfo, find ...)
 
How hot is the code path it's going to be on?
 
3:35 AM
I think that'll be used by MockProvider, really.
and only if we haven't gotten a cached type already
 
Remember, we're caching the ComProjects already - I'd think you'd want to look there first.
 
so the expense should be paid once already.
 
(at least for built in classes).
 
I haven't gotten to VBA types just yet. Waiting on Wayne's PR.
this would be for external classes like Scripting.FileSystemObject, Excel.Application, whatever.
 
The other benefit is that if you don't find it, you can cache the result as a ComProject.
 
3:38 AM
so have the MockProvider create a ComProject for a unrecognized library?
 
Yep.
 
do we already have a service for getting some existing ComProject?
 
I thought we did.
 
let me see...
 
I'd have to look.
The reason I bring it up is that I still want to eventually offer a late-bound -> early-bound refactoring and IntelliSense for late bound members (CreateObject derived variables).
Both of those need the exact same type of services - look up a ProgId, cache the result, optionally create declarations from it, etc.
 
3:41 AM
I guess I'd use IComLibraryProvider.LoadTypeLibrary
wait, no.
 
That sounds right.
 
that's just ITypeLib
not sure there's a way to get an ComProject. I still think I have to write some querying service for the Com*** types.
I suppose thinking about it, it makes more sense to cache all the types found in a library, rather than piecemeal.
That would avoid potential cache miss and invalid cast exception because whatever
 
It's not like they're going to change at run-time, either.
 
yeah
yeah, I think that's the right thing to do.
I see that ComCoClass doesn't store a ProgId, though
 
It easily could.
 
3:45 AM
but if we go through the entire library, then it's stupidly easy - sic ProgIdFromClsid (which I already have)
no traversing through all those structures and ref types.
 
Well there is, but it's already field tested for a couple years.
 
I'm thinking that they didn't think through the typelib/typeinfo API very well.
?
I don't see it on the class?
Or did I misunderstand?
 
ComProject essentially does all the traversal, it just doesn't discard anything on the way.
When you're done, it's a couple Linq statements to find what you need.
 
there's another problem, though.
for CachedTypeService to work, it needs to have had enumerated all related types.
 
I've kind of been wanting to do that anyway. That was the discussion issue.
 
3:50 AM
Maybe void AddLibrary(ComProject project), enumerate all its type, to fill the cache.
 
That's strongly related to #4252.
 
then MockProvider would be able to just query TryGetCachedType(string progId, string project, out Type type); ; it wouldn't need overloads.
 
Hell, you could make a set of .ToComMock extension methods.
 
ok, we're talking about a slightly different thing.
I'm talking about discovering all the interfaces that a coclass implements
you're talking about discovering all the referenced libraries
 
Oh, sure - but if you get the base typelib and resolve it, you can just query the resulting ComProject afterward.
 
3:53 AM
now, here's a scenario
I use the mocking framework to create a mock on say, MSHTML.Document
My VBA project currently does not reference the MSHTML library
So when the code runs and MockProvider goes asking for the types for it, we'll end up creating a new ComProject
 
Exactly.
 
But for parsing purpose, that shouldn't be considered.
Well, not exactly.
 
It wouldn't - the parser only enumerates referenced libraries.
 
no no, my concern is that with a new comproject added, the parser would now know about those that's not actually part of the VBA project
we'd need to track which ComProjects are actually referenced.
 
It already does.
 
3:56 AM
Oh.
Good.
 
Consider project A that references MSHTML and project B that doesn't. Same thing.
 
At least that'll enable us to do late-binding analysis
 
e.g. know that an Object variable is assigned MSHTML.Document. That'd be sicknasty
 
And on the flip side, if the late-binding analysis is done first, it's in the cache for the mock provider already.
 
3:58 AM
Ok, I was not sure about using Com*** primarily because I wasn't sure if I wanted to pay the cost of analyzing 10000 types when the Mock provider asked only for 1.
 
I'm guessing that would be the more likely scenario, actually - because if you're in need of a Mock of something, you're probably using one of them.
Reading a library is stupid fast.
 
But thinking about it, and considering that the Com collector is pretty blazingly fast, I can't lose much.
yep
compared to that silly arrow code... I'm ending up with less data.
 
And if it wasn't, that's an even better reason to keep them cached.
 
hmm yeah. I'll need to rethink how to handle the CachedTypeService.
I think it still should encapsulate the Marshal.TypeForITypeInfo and maybe? Type.TypeFromProgId to ensure we don't accidentally create 2 types for "same" thing
 
I think that makes sense - either that or provide a type lookup in the ComProject cache.
Or resolve the type as a lazy property of ComProject. I think I like that better.
Com* rather.
 
4:05 AM
Oh it will be lazy
but it must be static global cache
 
Why?
If the ComProject is cached and they're tied to each other, you only have to worry about the validity of one cache instead of 2.
 
No, the type must be always be equal
 
4:20 AM
Wait, you're right - we were discussing the possibility of ProgId collisions earlier.
 
Yeah, and once we get a Type it must be that same instance in subsequent invocation.
i like ToComMock but it must come from CachedTypeService
 
That makes sense.
This stupid issue is proving ridiculously hard to write tests for.
Do our Mocks even support parsing a project, adding a component, then reparsing it?
 
4:46 AM
I dont know. I would hope so?
i would think there is already unit tests that needs that
 
I found a work-around.
 
5:35 AM
[rubberduck-vba/Rubberduck] build for commit 446f1e1c on unknown branch: AppVeyor build succeeded
 
@Duga That PR wants a fast merge if anyone wants to give it a quick scan.
 
 
1 hour later…
6:58 AM
0
Q: How to convert range of image file path from local folder as comment in the selected destination range?

Karthik KarthikI'm asking for your help. My research ended up in 2 different macros that combined will give a good utility for my work. This VBA code will insert image as comment. This VBA code will fetch Hyperlinks(Local folder path only, not web based URL) and paste them in destination cell. I really trie...

 
 
2 hours later…
8:47 AM
0
Q: Getting totals of each primary key by comparing two worksheets

PherdindyAfter doing some bottleneck testing as shown below (code of interest is at row 10): I have already resolved several others using Application.Index with Application.WorksheetFunction.Match and reduced time to perform from about 7-8 seconds to milliseconds. My problem is with the code below as I ...

 
 
4 hours later…
1:24 PM
Early Bound: I get Intellisense in the VBE for programming convenience. However, if my end user doesn't have the exact same version of the installed support DLL, it can go up in flames.
Late Bound: I get no Intellisense when coding. However, so long as the method I'm calling is supported by the end user's version of the DLL being loaded, it doesn't matter what version they're on.
 
No, nor necessarily exact same,
 
@FreeMan Compatible version, not exact same.
 
^^ are those the primary advantages/disadvantges?
 
they only need equal or higher version
its the lower/older version that will go up in flames
 
@FreeMan No. The primary advantage of early binding is that you're not constantly interrogating the object for it's interface.
 
1:26 PM
@Comintern because that's already been done at compile-time, right?
 
Early Bound: Do Foo.
 
yes
 
Late Bound: Can you do Foo? Yes. OK, Then do Foo.
 
but TBH in a typical scenario, users are unlikely to notice the performance penalty
 
So the main advantage of late bound would be found if I have a diverse user group and I don't know what versions of software they may have installed. If I'm in a very homogeneous office environment where everyone is updated to the new version of "software x" within days, or at most weeks, then early bound is basically advantages all round.
 
1:30 PM
Depends on how heavily you're using the IDispatch.
 
it will hurt in a tight loop for sure
 
since I'll have to go google IDispatch, I'm not really sure I can answer that...
10 hours ago, by Comintern
The reason I bring it up is that I still want to eventually offer a late-bound -> early-bound refactoring and IntelliSense for late bound members (CreateObject derived variables).
was what prompted me to ask.
 
How many times you dereference on the object - each dot (.) is a single function call if you're early bound.
 
There is one more thing. You cannot have events on a late bound objects (typically)
 
Each . late bound is 3 if they did it right, 4 if they used a naive approach.
 
1:35 PM
i wonder if there is any optizimations done... E.g. Repeated invocation is cached so it is only 3/4 first time then 1 after?
 
That kind of what I was thinking. I.e., in a loop you really should cache GetIdOfNames, but you can't, because the spec doesn't forbid changing the return values at runtime.
There's nothing that says you couldn't just return random functions in the vtable.
 
Yeech
 
It would be a horrible way to implement it, but you know some idiot did at some point.
 
but of course!
 
  Dim Outlook As Outlook.Application
  Set Outlook = New Outlook.Application
  Dim MailMessage As Outlook.MailItem
  Set MailMessage = Outlook.CreateItem(0)
 
1:39 PM
@FreeMan Isn't the argument for CreateItem an enum member?
 
so each . above is a dereference?
 
Yes.
 
@Comintern probably. That's a copy/pasta for ya'
 
hm. No
i dont think the Outlook. counts the same way?
 
The . says "take the interface on the left side, and invoke the member on the right".
 
1:41 PM
thats the library, not interface
oh. Wait. Im an idiot
 
App object.
 
would Set MailMessage = Outlook.CreateItem(0).X.Y be more or less efficient than:
  Dim MailMessageX As MailItem.x
  Set MailMessageX = MailMessage.x
  Dim MailMessageY As MailMessageX.Y
  Set MailMessageY = MailMessageX.Y
in terms of dereferences?
 
wouldnt it get shadowed?
 
@FreeMan Count the dots. ;-)
 
.x and .y are made up for this example...
 
1:45 PM
@this Shadowed?
 
in the end, they end up the same, don't they? Dim MailMessage As = 1, Dim MailmessageX As = 2, Dim MailMessageY As = 3, while Outlook.CreateItem(0).X.Y = 3
or am I not counting correctly?
Both assume you have to Dim Outlook As at some point
Or does the individual Dim method have to dereference all the way from Outlook down for each individual call, it's just that VBA will kindly do it for me in the background?
 
@Comintern I was thinking about the fact that Dim Outlook As ... would shadow the app object but obviously I don't have enough caffeine. :(
 
No, it doesn't need to dereference back - you're storing the reference.
 
@MathieuGuindon Tweet-worthy.
 
@Comintern that makes sense, but by my count, the . ends up the same. What am I missing?
 
1:51 PM
If CreateItem returns a Object though, the longer version is better because you are storing typed interfaces.
 
@FreeMan, try this - you have a <interface>.<method> -- does the <method> another interface (aka object)? Yes, run another method on it? Yes, that's 2nd dot.
 
And of course there are other reasons to store the intermediate object even if you're late bound - i.e. you can test to see if it returned Nothing.
 
@this yeah, I mostly get that, it's just that I'm seeing the same number of dots in my made-up example so I'm not seeing the difference Comintern mentioned.
@Comintern this I can get behind as a good reason for the Dim all the thingsâ„¢ method!
 
Oh, that's the confusion - I didn't give an answer.
 
that's why I kept asking the question ;)
 
1:54 PM
When you "count the dots" you get no difference.
 
Note that you still can late-bind an early-bound object/library.
 
good to know I'm not crazy.
 
e.g. with an ADODB.Connection, it's possible to go myConnection.uspSomeRandomProcedure(a, b, c)
 
^^
 
(don't know if I got the syntax right, though)
 
1:55 PM
@this i.e. add Outlook to the awesome RD Reference Explorerâ„¢, yet still make it late bound.
 
Same with the method that returns IDispatch.
 
but that's supposed to let you run your custom stored procedure.
Yes. The most atrocious example in Access would be doing stuff like Forms!myForm!someControl = "abc"
 
@Comintern so what was the "count the dots" comment if it works out the same? Are there instances other than my contrived example where it won't (be the same number of dots)?
 
@FreeMan It's the method to determine how many times you dereference. As a general rule, you want to minimize the dots.
 
@Comintern Sorry :(
Remember, though, that was before the aggregation inspection result.
 
1:58 PM
@Hosch250 Meh.
 
So, we could literally have thousands of results, and sorting took over a minute.
 
@Comintern Ding!
Set MailMessageX = Outlook.MailItem(0).X
Set MailMessageY = Outlook.MailItem(0).X.Y
would be bad because there are 5 dots instead of just 3
Set MailMesageY = MailMessageX.Y would be the better alternative
Yay for caffeine kicking in!
 
Hmm, not sure.
 
me? haz a sad
 
using the Access example --- Forms!myForm!someControl as an example -
that looks like 2 "dots" but we should expand that into the dot versions....
Forms.Item("myForm").Controls("someControl").Value
And that's technically late-bound, as well. Let's make it really early bound....
Dim myForm As Form_frmForm

Set myForm = Forms.Item("myForm")
myForm.someControl.Value
This has the same number of dots but I would say that the latter will be better performing because it's all early-bound.
With the original and the 2nd expanded examples, we were using the generic Access.Form interface and default members (is there any performance penalty for implicit default access, @Comintern? ).
 
2:06 PM
@this so that is really the answer, except when you don't know what version of Access the end user is on so you can't add Access.15.DLL (or whatever) to the References list.
 
OTOH, the myForm variable which is typed to the specific class Form_myForm has the someControl on its interface, so it's early bound.
Note that all 3 syntaxes are valid in an Access VBA project where you can't remove Access reference anyway.
 
If I'm getting the gist correctly: Bind early and declare variables for any intermediate level objects that you're going to use multiple methods on whenever possible. Bind late, declare variables for any intermediate level objects that you're going to use multiple methods on when you don't know the software version the end-user is on because that version may not support the method you're calling.
(As an added bonus, build in alternate methods of getting to the end point, or at least an elegant method to handle the missing methods.)
 
don't forget events.
 
^ as general rules because #ItDepends
 
Late-bound => no events generally.
 
2:10 PM
ah, yes.
 
Unless you're me and cheat with Wayne's vbDotNetLoader ;-)
 
In general Early bound is the preferred method all 'round.
Late bound should only be used if absolutely necessary.
 
Yes it comes down to whether you have the control over the environment.
 
#InGeneral #ItDepends
 
If you don't, you should late-bind.
Note that this isn't true for locked references.
 
2:12 PM
OK. That was a long convoluted way of getting to "FreeMan doesn't have to refactor anything in his current projects". :)
But educational, too.
 
e.g. opening an Excel VBA project that was authored in Excel 16 in an Excel 12 application is OK
 
*for some values of "anything"
 
but opening an Excel VBA project that references Word 16 in an Excel 12 application => KA-BOOM
 
@this but... What if I'm calling methods that don't exist in Excel 12? no KA-BOOM?
 
In those cases, the locked references are loaded by host so it's always fixed to that host's version. But any extra references, yer on your own, buddy.
Oh yes it will ka-boom. Just later.
 
2:13 PM
got it!
 
e.g. runtime, not at startup
 
in that case, apply some late-bound logic around potentially missing methods from older run times and all is good.
 
you can conceviably avoid this by doing like If Excel.Application.Version >= 16 Then RunSomeFancyPantMethodAddedToExcel16
yeah
there's also the option of conditional compilation, which removes the penalty of runtime checks.
 
@this If I were to install (for some brain-dead, corporate IT based reasons) Word 16 and Excel 12 on my machine, I'd be good to go, though, right?
 
yep
 
2:16 PM
:D
 
That would be particularly true with Outlook. :(
 
thankful that our IT isn't that brain-dead
 
Outlook is all "THERE CAN BE ONLY ONE!!!"
 
my precious
@this I could install multiple versions in multiple VMs, right? Can I install the same win10 (or win7/8/9) license key in multiple VMs without getting any sort of MS aggro? he asks, switching topics
 
if it lets you.
I believe that some keys have restrictions RE: multiple installation so it depends on what it's licnesed for
 
2:36 PM
@Comintern just to double check I'm not being oblivious - I cannot see any place where we are in fact caching the ComProjects -- in the library reference collector, we just new it up to collect the declarations then dispose of it. Is that right?
 
Stupid ISP.
@this Hmmm... I might have remembered that incorrectly. If we aren't, we should be.
 
"Debuggers don't remove bugs. They only show them in slow motion." - Unknown
 
@this Early bound, no - there is no difference in the default member. Late bound shouldn't matter - it would just request the method by dispid instead of name.
 
@Comintern in which case, I might need to also wait for Max's PR
though his PR is more for user's project in specific, we probably will need a ComObjectQueryService to cache all the ComProject and do queries on it.
 
@this kinda what I thought.
 
2:45 PM
@Hosch250 I ran into the same type of issue with the CE, and the solution is completely non-obvious. If you do an in-place sort, you can minimize the number of collection add and remove events. It's the item rendering that kills.
 
@Comintern Yeah, I knew that much. The sort would finish fast either way, but the rendering killed it.
How'd you solve it?
 
In-place sort and indexed inserts.
 
Oh, you mean WPF could figure out to rearrange things without needing to re-render everything?
 
Hmmm.
Nice job.
 
2:51 PM
No, just minimize the number of adds and removes.
@Hosch250 Thanks.
 
3:39 PM
@Comintern We only cache the library COM projects in the tests.
There, we use a caching decorator for the COM project loader.
 
@M.Doerner I think we may need to start caching all COM projects, users' or referenced.
Based on the discussion last night, I'm thinking the mocking framework would be better off if it could use the cached COM projects.
 
Caching the user projects in my PR is a bit different.
Every change to a user project invalidates the COM project.
For libraries, that should never happen.
 
hmmm. Actually I realize that can cause problems for mocking.
 
I mean, during one session.
 
With mocking, I'm statically caching the types that I create for mocking to work around the broken equivalence
But if I'm mocking a user defined type, that probably should be invalidated, too.
 
3:43 PM
That will not work for user projects.
They are highly volatile.
 
Yeah. I'll have to handle the types from user-defined projects differently.
The problem is more that I should not get a 2nd invocation of type-creating method executed, which will return a similar but incompatible type.
 
@this You're referring to the creation of multiple mocks of a single user type during one runtime?
 
so within a run of unit testings, the types should be static.
Yeah
e.g. I run several unit tests, each creating a new mock of some user defined objects
Those all must be based on the same System.Type
 
Right.
 
created from the first invocation of Marshal.TypeForITypeInfo or such.
Of course, if the user defined project is updated, those types should be invalidated, probably since I can't be sure they are still the "same"
 
3:46 PM
Sounds like the user type cache should be tied to the UT lifetime then.
 
Yes, I think so.
 
(for your purposes, not the parser's)
 
so I now have more caches. Gee thanks, folks!
:D
 
You're complaining about having too much cache?
 
caches.
 
3:48 PM
Humor fail.
 
hey, remember you're talking to Captain Oblivious.
 
00:00 - 16:0016:00 - 00:00

« first day (1687 days earlier)      last day (1493 days later) »