fsprojects-archive / zzarchive-VisualFSharpPowerTools

[ARCHIVED] Power commands for F# in Visual Studio
http://fsprojects.github.io/VisualFSharpPowerTools/
Apache License 2.0
310 stars 77 forks source link

Generative Type provider with inheritance causes erroneous errors to display #1388

Closed ReedCopsey closed 8 years ago

ReedCopsey commented 8 years ago

Description

If using a generative type provider where the types are not marked Sealed, the F# Compiler handles this perfectly. However, having the power tools installed causes erroneous errors to show in Error List and red lines to display after compiling.

Repro steps

Repro project at: https://github.com/ReedCopsey/FSPT_TP_Repro

Open Repro project, MainView.xaml.fs file. Build solution.

Expected behavior

With Power Tools disabled, it builds and works perfectly:

No Power Tools Installed

Actual behavior

With Power Tools enabled, you get:

Power Tools Installed

Note that it builds correctly - but you get extra errors (which show up asynchronously after build completes).

Known workarounds

vasily-kirichenko commented 8 years ago

Interesting since we do nothing with reporting errors...

ReedCopsey commented 8 years ago

@vasily-kirichenko Yes - it's very odd. I tried to look at what might be causing it - but couldn't figure it out. It's night and day though - enable or install the extension, and this lights up.

dsyme commented 8 years ago

@ReedCopsey Using VFPT will cause the type provider to be instantiated multiple times simultaneously from the same devenv.exe process (at least once for VFT and once for VFPT).

If your type provider uses global state in unsafe or incoherent ways then it could cause bad behaviour. Could that be a possible cause of the problem?

ReedCopsey commented 8 years ago

@dsyme Not that I know of - unless it's happening within ProvidedTypes.fs with generative type providers somewhere. The type provider itself doesn't do anything with global state.

ReedCopsey commented 8 years ago

I may have realized what's causing this just now...

This is for FsXaml - I've just put out some significant improvements to it. However, VFPT uses (and old version of) this type provider and library itself, so I suspect that the process when VFPT is running is picking up the old version, which is no longer binary compatible.

@dsyme does this seem reasonable? Could it cause this type of thing to creep up?

/cc @vasily-kirichenko

dsyme commented 8 years ago

@ReedCopsey Yes, version interference sounds likely. Alas type providers do not run isolated in devenv.exe.

ReedCopsey commented 8 years ago

@dsyme Thank - I'll close this for now, and do a PR against VFPT to update as soon as I release 2.0 formally. Hopefully that will correct, but if not, I'll reopen then.