History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-919
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Marcus Griep
Reporter: Marcus Griep
Votes: 0
Watchers: 0
Operations

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

Compiler doesn't notice inherited indexers on external interfaces

Created: 16/Nov/07 03:22 PM   Updated: 16/Nov/07 04:00 PM
Component/s: Compiler
Affects Version/s: 0.8
Fix Version/s: 0.8.1

Time Tracking:
Not Specified

Testcase included: yes


 Description  « Hide
Take the following two assemblies:
namespace Test

interface IBase:
  self[i as int] as object:
    get
    set

interface IDerived(IBase):
  pass

class Derived(IDerived):
  self[i as int] as object:
    get:
      print "Got ${i}"
      return object()
    set:
      print "Set ${i} to ${value}"
"""
Got 42
System.Object
Set 613 to Good
"""
namespace Test

ider = Derived() as IDerived
print ider[42]
ider[613] = "Good"

This prints the following error:

interface_2b.boo(7,7): BCE0048: Type 'Test.IDerived' does not support slicing.

As a single assembly, this acts as expected.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Marcus Griep - 16/Nov/07 04:00 PM
Another example that comes from using System.Data:
import System
import System.Data
import System.Data.SqlClient

sql = SqlCommand() as IDbCommand

try:
	reader = sql.ExecuteReader()
except as InvalidOperationException:
	caught = true
	
assert caught

try:
	print reader[0]
except as NullReferenceException:
	caughtAgain = true

assert caughtAgain

Marcus Griep - 16/Nov/07 04:00 PM
Revision 2754