Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 321651

Summary: [compiler][otre] array-translations (lifting/lowering) in nested team not properly translated
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTJAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.7   
Target Milestone: 0.7.1   
Hardware: Other   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
fixes none

Description Stephan Herrmann CLA 2010-08-03 16:19:04 EDT
When a nested team performs lowering/lifting for arrays of its (nested) role,
both compiler and otre currently fail, mainly because lifting/lowering
requires the use of an appropriate team-method, but those methods are searched
for in the enclosing team, rather in the nested team itself.

Although r671 already fixed an easy issue (witnessed by test2215_arrayLifting6)
additional test test2215_arrayLifting7() shows more problems in this area.
Comment 1 Stephan Herrmann CLA 2010-08-03 16:28:15 EDT
Created attachment 175808 [details]
fixes

Various fixes as needed for test2215_arrayLifting7():

* callin-wrapper didn't find lift method because search started at the
  enclosing team
  (rather than expecting role to be a team with lift-methods, too)

* array-lowering of base-call result didn't find a suitable call target,
  because lowering as inserted by InsertTypeAdjustmentsVisitor didn't have
  enough context (recall that callin wrappers are out off its scope).
  * insert an explicit PotentialLowerExpression
  * feed the appropriate team expression into the PotentialLowerExpression
    and from there into ArrayLowering

* array-lowering in a nested team should resolve to the interface method for 
  easier use at the call-site

* OTRE adjustment for base-call surrogates 
  (these seem to be independent of the issue of arrays):
  * select this or this$n
  * use the correct receiver type for the lifting call.
Comment 2 Stephan Herrmann CLA 2010-08-03 16:29:49 EDT
Patch has been committed as r672, r673.
Comment 3 Stephan Herrmann CLA 2010-08-03 17:53:57 EDT
r674 fixes a regression in test1129_nestedCallin2() caused by this patch:
More work was needed to determine the correct receiver for array-lowering
of a callin result.
Comment 4 Stephan Herrmann CLA 2010-09-23 08:56:27 EDT
Verified using I201009211735