| Summary: | [compiler] generated lift methods fail to detect some lifting ambiguities | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] Objectteams | Reporter: | Stephan Herrmann <stephan.herrmann> | ||||||
| Component: | OTJ | Assignee: | Stephan Herrmann <stephan.herrmann> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | ||||||||
| Version: | 0.7.1 | ||||||||
| Target Milestone: | 0.8 M3 | ||||||||
| Hardware: | Other | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Stephan Herrmann
Created attachment 181341 [details]
fix
Fixed by actually performing a simplification:
- no longer filter ambiguous roles from the array of relevant roles
- do not use exact type checks but rely on the order of generated
instanceof checks: most specifics come first
+ add explicit case statements for throwing LiftingFailedException
if an ambiguous base is the most specific match.
Created attachment 181585 [details]
additional fix
More fixes:
- Sorting must consider roles (fully connected hierarchy) and bases
(hierarchy may contain holes)
fixes regression in BindingAmbiguitiesM.test73M_ambiguousBinding2()
- simplify generated code by avoiding duplicates in relevantRoles
(use set instead of list)
also avoid adding nulls to simplify iterating
Other related fixes have been committed as:
r974:
fixed a regression (NPE) in test219_playedbyInheritance4, triggered
(but not caused) by r967
r975
fix regression re test921_hasRoleMethod5c2
-> more precise analysis of when binding ambiguity is relevant
(consider base & static role type).
With all listed fixes all tests pass again, marking as fixed. Verified for 0.8 M3 using build 201011100445 (by inspecting tests in BindingAmbiguities*). |