Saltarelle / SaltarelleCompiler

C# to JavaScript compiler – Now http://bridge.net
http://saltarelle-compiler.com
Other
297 stars 74 forks source link

global:: is not supported in parameters for Attributes #393

Closed mudHOAX closed 7 years ago

mudHOAX commented 9 years ago

When attempting to use the global keyword within a attribute parameter we are encountering an error.

[DefaultMemberReflectability(global::System.Runtime.CompilerServices.MemberReflectability.PublicAndProtected)]
public class Bar
{
}

This causes the following exception to be thrown on build:

INTERNAL ERROR: System.ArgumentNullException: Value cannot be null.
   Parameter name: value
     at System.Enum.ToObject(Type enumType, Object value)
     at Saltarelle.Compiler.AttributeStore.ChangeType(Object source, Type type)
     at Saltarelle.Compiler.AttributeStore.ReadAttribute(IAttribute attr, Type attributeType)
     at Saltarelle.Compiler.AttributeStore.ReadAttributes[T](T t, IEnumerable`1 attributes, List`1 transformers)
     at Saltarelle.Compiler.AttributeStore..ctor(ICompilation compilation, IErrorReporter errorReporter)
     at Saltarelle.Compiler.Driver.CompilerDriver.Compile(CompilerOptions options). 
     Saltarelle.Compiler.targets          32
erik-kallen commented 9 years ago

This is a bug, but I think it will need to wait for version 3 before it can be fixed (the global:: prefix is not supported by NRefactory).

geoffreymcgill commented 7 years ago

It appears this is an issue in Bridge as well. We are investigating, and have created the following issue to track our progress:

https://github.com/bridgedotnet/Bridge/issues/2191

Closing this issue and will now track in Bridge.