[7.8.1][Glorp]Flaw in auto-resolution of descriptorMethods

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[7.8.1][Glorp]Flaw in auto-resolution of descriptorMethods

Henrik Sperre Johansen
Hi!
The lookup of classes for descriptorMethods done in constructAllClasses
is flawed.

It ends up using:
Dialect >> lookupClassNamed: aString inContextOf: aClass ifAbsent: aBlock
     "Look up the class by name, but use the namespace of the class.
Mostly useful if we're trying to guess from unqualified names in
dialects with namespaces."
     self isVisualWorks ifFalse: [^self smalltalkAt: aString ifAbsent:
aBlock].
     ^aClass environment at: aString ifAbsent: aBlock.

As such, any classes in namespaces imported in the DescriptorSystem
class itself will fail to be found.

In other words:

A defineClass: MyDescriptorSystem
     imports: 'B.*'
...
MyDescriptorSystem >> descriptorForMyClass:

B define: MyClass

fails to find MyClass during verification when a MyDescriptorSystem is
created.

If the import of B is moved to A, it works, but that's not always what
one wants.

Cheers,
Henry
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [7.8.1][Glorp]Flaw in auto-resolution of descriptorMethods

Niall Ross
Dear Henrik
    AR 66712 Glorp descriptor construction does not see namespaces
imported into its class namespace.

Thanks for pointing this out.

             Yours faithfully
                   Niall Ross

Henrik Sperre Johansen wrote:

> Hi!
> The lookup of classes for descriptorMethods done in
> constructAllClasses is flawed.
>
> It ends up using:
> Dialect >> lookupClassNamed: aString inContextOf: aClass ifAbsent: aBlock
>     "Look up the class by name, but use the namespace of the class.
> Mostly useful if we're trying to guess from unqualified names in
> dialects with namespaces."
>     self isVisualWorks ifFalse: [^self smalltalkAt: aString ifAbsent:
> aBlock].
>     ^aClass environment at: aString ifAbsent: aBlock.
>
> As such, any classes in namespaces imported in the DescriptorSystem
> class itself will fail to be found.
>
> In other words:
>
> A defineClass: MyDescriptorSystem
>     imports: 'B.*'
> ...
> MyDescriptorSystem >> descriptorForMyClass:
>
> B define: MyClass
>
> fails to find MyClass during verification when a MyDescriptorSystem is
> created.
>
> If the import of B is moved to A, it works, but that's not always what
> one wants.
>
> Cheers,
> Henry
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
>


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc