Issue Details (XML | Word | Printable)

Key: BOO-1047
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Avishay Lavie
Reporter: Avishay Lavie
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

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

Created: 07/Jun/08 07:19 PM   Updated: 22/Jan/09 09:22 AM   Resolved: 01/Oct/08 03:46 PM
Return to search
Component/s: None
Affects Version/s: 0.8.2, 0.9
Fix Version/s: 0.9

Time Tracking:
Not Specified

Environment: MS.NET / Windows

Testcase included: yes


 Description  « Hide
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'.



Greg Nagel added a comment - 08/Jun/08 01:38 PM

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.


Avishay Lavie added a comment - 01/Oct/08 03:46 PM

Resolved in 3042.