comments

Issue is that at line 2677 of StorageMappingItemLoader (and also at line 2667 though we're not hitting that in this scenario) we are creating and adding errors to the list but failing to set the local flag errorsFound to true.

Later this means we a) raise the Assert and b) return true where we should return false. If we had returned false we would have returned false immediately from the next method in the call stack (and so on down the stack); instead we create other objects and
return an invalid true - which leads the runtime to think it's constructing a valid model when it isn't.

Create a new project and add an EDMX which points to that DB. Include the 2 TVFs (note: you should get 2 complex types created representing the return types of the 2 TVFs)

Open the EDMX and from there open the Model Browser (if not already open)

In the Model Browser expand Function Imports and select one of the TVFs, right-click it and select "Function Import Mapping"

In the Mapping Details window on the line that says "Maps to <Function_Name>", select that line and in the drop down select the other incompatible Function.

Right-click on the background of the designer and select "Validate"

This used to bring up an Assertion-Failed dialog with the above stack trace. Fix will be not to see this dialog - just the errors in the Error List window (which you should expect because the mapping will no longer work).

First fix was to prevent the EF6 provider not being registered if you open and close the above project - #d29f610. This was preventing us seeing the above dialog if you had ever closed the project once you created it.

Second fix checked into runtime - we were failing to assign the errorFound flag when we found that sort of error. This in turn triggered the Assert (and made the method incorrectly return true when it should return false which had knock-on effects).