Boo
  1. Boo
  2. BOO-1167

BCE0149 on external method that has generic argument constraint referencing declaring type's external constructed generic argument

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: 0.9
    • Fix Version/s: 0.9.5
    • Component/s: Compiler
    • Labels:
      None
    • Testcase included:
      yes
    • Number of attachments :
      0

      Description

      External code:

      using System.Collections.Generic;
      public class D {
      }
      public class C<T> {
      	public IEnumerable<U> Do<U> () where U : T
      	{
      		return null;
      	}
      }
      

      Caller code:

      class B:
          pass
      C[of B]().Do[of B]() #B is internal, it works!
      
      C[of D]().Do[of D]() #D is external -> BCE0149 :(
      

      Gives:
      BCE0149: The type 'B' must derive from 'T' in order to substitute the generic parameter 'U' in 'C[of T].Do()'.

      Marking it Blocker for 0.9.1 as it blocks MonoDevelop guys wrt BooBinding.
      Thanks to Michael Hutchinson for reporting.

      FWIW, internal code works (testcase-worthy anyway):

      class B:
          pass
      class D (B):
          pass
      
      class C[of T]:
          def Do[of U(T)]() as U*:
              pass
      
      C[of B]().Do[of B]()
      

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Rodrigo B. de Oliveira
              Reporter:
              Cedric Vivier
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: