Boo

Internal compiler error when invoking external generic method where type inference violates generic constraints

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.8.2, 0.9
  • Fix Version/s: 0.9
  • Component/s: None
  • Labels:
    None
  • Environment:
    MS.NET / Windows
  • Testcase included:
    yes
  • Number of attachments :
    0

Description

import System.Threading.Interlocked

x as int = 10
CompareExchange(x, 5, 5)

Gives:

{{test.boo(4,16): BCE0055: Internal compiler error: GenericArguments[0], 'System.Int32', on 'T CompareExchange[T](T ByRef, T, T)' violates the constraint of type 'T'.}}

Activity

Hide
Greg Nagel added a comment -

The checking may already be in place to normally disallow this, but there's an integer overload for that function. The real bug is that the compiler picks the generic version over the integer overload.

Show
Greg Nagel added a comment - The checking may already be in place to normally disallow this, but there's an integer overload for that function. The real bug is that the compiler picks the generic version over the integer overload.
Hide
Avishay Lavie added a comment -

Resolved in 3042.

Show
Avishay Lavie added a comment - Resolved in 3042.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: