I am getting this message
” Check that your C# source compiles and that you are not using an unsupported feature”
And do not know how to work out what I am doing wrong. Does anybody know?
I understand the general concept of what its saying but I need something more specifc
EDIT: I was not asking to have a specific instance doiagnosed. I was asking if there was a compiler switch that would give more info
Anyway here is the failing code
[ScriptName("Ext")]
[IgnoreNamespace]
[Imported()]
public partial class Ext //: ext.data.Store
{
[ScriptName("create")]
public static object Create(string name, object config)
{
return null;
}
}
public sealed class viewport
{
public static viewport MakeViewPort()
{
return new viewport();
//return (viewport)extwrap.Ext.Create("Ext.container.ViewPort", null);
}
}
public class Class1
{
public void foo()
{
jslate.viewport vp = jslate.viewport.MakeViewPort(); <=== fails here
}
}
I am trying to get round the fact that extjs4 does not allow
var win = new Ext.Window
instead you do
var win = Ext.create('Ext.window')
You can see various attempts at this. All compile but get bounced by S#
The error you’re encountering is the case where unfortunately the compiler failed, and consequently couldn’t report a better error. You’ll see similar internal compiler errors for other languages (incl. c#) if you do something that makes it really unhappy. While I totally agree it would be useful to generate better errors wherever possible, there are a few cases where detecting the unsupported construct is as good as doing the work for supporting the construct.
I hope you are able to and using the latest compiler version – things have been continually improving in the error experience from build to build … for example reporting the c# line #, compiling the rest of the c# code, and emitting an error statement in the resulting javascript for the failing line instead of all or nothing approach, as well as better error reporting in the msbuild path.
In this particular case, I suspect the use of namespace-qualified type names (extwrap.Ext and jslate.viewport) in the code above is behind the error. Actually this limitation was listed in the script# readme (that used to be available earlier, but was removed since a portion of the doc was out-of-date … sorry about that… need to get something back online or included in the setup.)
Also, as fyi – rethinking some core parts of script# compilation approach to once and for all take care of a bunch of issues. I’d like to get this started, and then publish the sources for the compiler. Getting this fundamental change in place is what is gating next step in bringing the full project on GitHub … for those tracking the progress there.