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

Key: BOO-724
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Rodrigo B. de Oliveira
Reporter: Andrew Davey
Votes: 1
Watchers: 0
Operations

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

Private fields conflict with same named fields in child class

Created: 19/Apr/06 03:39 PM   Updated: 30/May/07 09:55 AM
Component/s: Compiler
Affects Version/s: 0.7.5
Fix Version/s: 0.7.8

Time Tracking:
Not Specified

File Attachments: 1. Text File BOO-724-v3.patch (3 kb)

Environment: Windows XP Pro SP2, SharpDevelop 2.0.0.1291


 Description  « Hide
[snip]
class Foo:
private _x as object

class Bar(Foo):
private _x as string

def constructor():
_x = "foo"
[/snip]

This code causes the compiler to complain "Expression cannot be assigned to" on the _x = "foo" line.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Max Bolingbroke - 01/Apr/07 05:22 AM
This also causes this problem (from Socrates877 on the mailing list):

class A:
private _field as int

class B(A):
private _field as string

def Explosion():
print(_field)

Ambiguous reference '_field': Data.B._field, Data.A._field. (BCE0004)


Max Bolingbroke - 01/Apr/07 05:23 AM
Patch to strip inaccessible references during ProcessMethodModies during ambiguity resolution.

Max Bolingbroke - 01/Apr/07 05:30 AM
On second thoughts, should we use ResolveAmbiguousReferenceByAccessibility before doing anything else? That might fix e.g. BOO-477

Max Bolingbroke - 02/Apr/07 05:09 PM
At Avishs suggestion added a test case for protected, internal, public...

Arron Washington - 03/Apr/07 03:38 PM
Someone review this patch yet?

Rodrigo B. de Oliveira - 30/May/07 09:41 AM
I'm taking care of it.

Rodrigo B. de Oliveira - 30/May/07 09:55 AM
Patch applied. Thanks!