Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash with modules with only extension methods #317

Closed
edhzsz opened this issue Jun 2, 2015 · 1 comment
Closed

Crash with modules with only extension methods #317

edhzsz opened this issue Jun 2, 2015 · 1 comment

Comments

@edhzsz
Copy link
Contributor

edhzsz commented Jun 2, 2015

The following module

[<System.Runtime.CompilerServices.Extension>]
module ExtensionMethods =
   [<System.Runtime.CompilerServices.Extension>]
   let Exists(opt : Module option) = opt.IsSome

Crashes when it does not have [omit] with the following stack trace

Microsoft.FSharp.Compiler.ErrorLogger+StopProcessing: Exception of type 'Microsoft.FSharp.Compiler.ErrorLogger+StopProcessing' was thrown.
  at Microsoft.FSharp.Compiler.Interactive.Shell.ErrorLoggerThatStopsOnFirstError.ErrorSinkHelper[a](PhasedError err) in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\fsi\fsi.fs:line 482
  at Microsoft.FSharp.Compiler.Interactive.Shell.ErrorLoggerThatStopsOnFirstError.ErrorSinkImpl(PhasedError err) in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\fsi\fsi.fs:line 497
  at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ErrorLogger.Error[b](ErrorLogger x, Exception exn) in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\ErrorLogger.fs:line 321
  at Microsoft.FSharp.Compiler.Tast.EntityRef.get_Deref() in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\tast.fs:line 2585
  at Microsoft.FSharp.Compiler.SourceCodeServices.FSharpEntity.get_CompiledName() in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\vs\Symbols.fs:line 211
  at FSharp.MetadataFormat.ValueReader.hasAttrib@221.Invoke(FSharpAttribute a)
  at Microsoft.FSharp.Collections.SeqModule.Exists[T](FSharpFunc`2 predicate, IEnumerable`1 source)
  at FSharp.MetadataFormat.ValueReader.buildUsage@342(FSharpMemberOrFunctionOrValue v, FSharpOption`1 args)
  at FSharp.MetadataFormat.ValueReader.buildShortUsage@403.Invoke(Int32 length)
  at RazorEngine.Compilation.ImpromptuInterface.Optimization.InvokeHelper.InvokeMemberTargetType[TTarget,TReturn](CallSite& callsite, Type binderType, Int32 knownType, LazyBinder binder, String_OR_InvokeMemberName name, Boolean staticContext, Type context, String[] argNames, TTarget target, Object[] args)
  at RazorEngine.Compilation.ImpromptuInterface.Optimization.InvokeHelper.InvokeMemberCallSite(Object target, String_OR_InvokeMemberName name, Object[] args, String[] tArgNames, Type tContext, Boolean tStaticContext, CallSite& callSite)
  at RazorEngine.Compilation.ImpromptuInterface.Impromptu.InvokeMember(Object target, String_OR_InvokeMemberName name, Object[] args)
  at RazorEngine.Compilation.ImpromptuInterface.Dynamic.Invocation.Invoke(Object target, Object[] args)
  at RazorEngine.Compilation.ImpromptuInterface.Dynamic.Invocation.InvokeWithStoredArgs(Object target)
  at RazorEngine.Compilation.RazorDynamicObject.MarshalWrapper.GetResult(Invocation invocation)
  at RazorEngine.Compilation.RazorDynamicObject.RemoteInvoke(Invocation invocation, Object& result)
  at RazorEngine.Compilation.RazorDynamicObject.TryInvokeMember(InvokeMemberBinder binder, Object[] args, Object& result)
  at CallSite.Target(Closure , CallSite , Object , Int32 )
  at CompiledRazorTemplates.Dynamic.RazorEngine_9128ddeeeb894d75a45feeca04f65f76.Execute()
  at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
  at RazorEngine.Templating.TemplateBase.<>c__DisplayClass3.<Include>b__2(TextWriter tw)
  at RazorEngine.Templating.TemplateWriter.WriteTo(TextWriter writer)
  at RazorEngine.Templating.TemplateBase.Write(TemplateWriter helper)
  at CompiledRazorTemplates.Dynamic.RazorEngine_6b81022106eb49548f3e4b4115f740e7.Execute()
  at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
  at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
  at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
  at RazorEngine.Templating.DynamicWrapperService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
  at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass1.<RunCompile>b__0(TextWriter writer)
  at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
  at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, ITemplateKey key, Type modelType, Object model, DynamicViewBag viewBag)
  at <StartupCode$FSharp-MetadataFormat>.$Razor.ProcessFileModel@248.Invoke(Unit _arg1)
  at FSharp.MetadataFormat.RazorRender.handleCompile[a](String source, FSharpFunc`2 f)
  at FSharp.MetadataFormat.RazorRender.ProcessFileModel[b](Type modelType, Object model, FSharpOption`1 properties)
  at FSharp.MetadataFormat.RazorRender`1.ProcessFile[a](model model, FSharpOption`1 properties)
  at FSharp.MetadataFormat.MetadataFormat.Generate(FSharpList`1 dllFiles, String outDir, FSharpList`1 layoutRoots, FSharpOption`1 parameters, FSharpOption`1 namespaceTemplate, FSharpOption`1 moduleTemplate, FSharpOption`1 typeTemplate, FSharpOption`1 xmlFile, FSharpOption`1 sourceRepo, FSharpOption`1 sourceFolder, FSharpOption`1 publicOnly, FSharpOption`1 libDirs, FSharpOption`1 otherFlags, FSharpOption`1 markDownComments, FSharpOption`1 urlRangeHighlight, FSharpOption`1 assemblyReferences)
  at <StartupCode$FSI_0004>.$FSI_0004.main@() in C:\Users\hernaned\Documents\GitHub\FSharp.Formatting\docs\tools\generate.fsx:line 138
@edhzsz
Copy link
Contributor Author

edhzsz commented Jun 10, 2015

Duplicate of #201

@edhzsz edhzsz closed this as completed Jun 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant