You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Evaluating the following in FSI results in an internal error
~vs514B.fsx(35,6): error FS0073: internal error: Undefined or unsolved type variable: 'a
The error marker corresponds to the line type DelayedAdornerUpdater ...
#r "PresentationCore"
#r "PresentationFramework"
#r "System.Xaml"
#r "UIAutomationTypes"
#r "WindowsBase"openSystemopenSystem.WindowsopenSystem.Windows.DocumentsletFindAdorner(layer :AdornerLayer)(e :UIElement):#Adorner =if layer <>nullthenletadorners= layer.GetAdorners e
if adorners <>nullthenlet mutableiter=0let mutableresult=nullwhile(not(Object.ReferenceEquals(result,null)))&& iter < adorners.Length domatch adorners.[iter]with|:? #Adorner as a -> result <- a
|_->()
iter <- iter +1
result
elsenullelsenullletUpdateLoadedAdorner(updater :FrameworkElement*AdornerLayer*#Adorner->unit, fe : FrameworkElement)=letlayer= AdornerLayer.GetAdornerLayer fe
if layer <>nullthenletadorner= FindAdorner layer fe
updater (fe, layer, adorner)typeDelayedAdornerUpdater(updater: FrameworkElement*AdornerLayer*#Adorner->unit,fe: FrameworkElement)asthis=letonLoaded sender args =
fe.Loaded.RemoveHandler this.OnLoaded
UpdateLoadedAdorner (updater, fe)memberthis.OnLoaded= RoutedEventHandler onLoaded
letUpdateAdorner(updater :FrameworkElement*AdornerLayer*#Adorner->unit)(e :UIElement):unit =match e with|:? FrameworkElement as fe ->if fe.IsLoaded then UpdateLoadedAdorner (updater, fe)elseletupdater= DelayedAdornerUpdater (updater, fe)
fe.Loaded.AddHandler updater.OnLoaded
|_->()
comments
marten_range wrote Oct 22, 2014 at 12:17 PM [x]
Rewriting DelayedAdornerUpdater to this seems to get the compiler on the right track:
type DelayedAdornerUpdater<'Adorner when 'Adorner :> Adorner and 'Adorner : null>(updater : FrameworkElement_AdornerLayer_'Adorner->unit, fe : FrameworkElement) as this =
opened on CodePlex by marten_range
Evaluating the following in FSI results in an internal error
The error marker corresponds to the line
type DelayedAdornerUpdater ...
The text was updated successfully, but these errors were encountered: