Commit e6d212d1 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ alternative implementation for TypeReferenceTail_Type resolution (nested types), #30

parent f2f55652
Loading
Loading
Loading
Loading
+21 −5
Original line number Diff line number Diff line
@@ -634,12 +634,28 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider {
		EReference ref
	) {
		//TODO: check performance, need to apply to other defs
		if ((eContainer as TypeReference).head instanceof ImportAlias) {
			scopeFor(((eContainer as TypeReference).head.eContainer as SpecTypeElement).directTypeElements)
		var container = eContainer
		if (container instanceof TypeReference) {
			if (container.head instanceof ImportAlias) {
				//TODO: this still uses the tail trail..
				scopeFor((container.head.eContainer as SpecTypeElement).directTypeElements)
			} else {
			tailTrail.putIfAbsent(it, 0);
			tailTrailCurrent.putIfAbsent(it, 0);
			scopeFor((eContainer as SpecTypeElement).directTypeElements)
				scopeFor(container.head.fields)
			}
		} else if (container instanceof TypeReferenceTail) {
			var type = container.type
			if (type instanceof ReferencedType) {
				var fields = type.directElements
				scopeFor(fields)	
			} else if (type instanceof FieldReference) {
				var fields = type.scopeFieldReferences
				scopeFor(fields)	
			}
		} else {
			//TODO: handle? 
//			tailTrail.putIfAbsent(it, 0);
//			tailTrailCurrent.putIfAbsent(it, 0);
//			scopeFor((eContainer as SpecTypeElement).directTypeElements)
		}
	}