error with generic constraints in callable and issue with constraint on an interface that's not in the same source file

View: New views
1 Messages — Rating Filter:   Alert me  

error with generic constraints in callable and issue with constraint on an interface that's not in the same source file

by Jeffery Olson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


concerning the first item:

public callable CallableWithT[of T(ISomeInterface)](foo as int) as T

public interface ISomeInterface:
  Id as int:
    get

public class SomeClass:
  _id as int
  Id as int:
    get:
      return _id

  public def constructor(id as int):
    _id = id

public class AnotherClass:
  public def GenericMethod[of T(ISomeInterface)](arg as
CallableWithT[of T]) as T:
    pass


fall down boom:
Internal compiler error: Object reference not set to an instance of an
object.. (BCE0055) - C:\Users\Administrator\Documents\SharpDevelop
Projects\Sandbox\ConstraintsTest.boo:21,57


concerning the second item:


and with that above code, if you moved ISomeInterface to another
source code file and tried to compile AnotherClass, you'd get:
An error occurred during the execution of the step
'Boo.Lang.Compiler.Steps.EmitAssembly': 'Could not load type
'Sandbox.ISomeInterface' from assembly 'Sandbox, Version=1.0.3552.0,
Culture=neutral, PublicKeyToken=null'.'. (BCE0011)


interestingly, as mentioned above, if the interface is in the same
source file as the class that uses it in a constraint, it compiles
without issue.. this is from a nightly build of #dev (the 'About'
dialog says all of the boo assemblies are 0.9.2, but no rev # info)

cheers

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang?hl=en
-~----------~----~----~----~------~----~------~--~---