Skip to content

Added two explicit types to avoid undesired behaviour of Rascal typechecker#22

Merged
mahills merged 1 commit intomainfrom
fix/typechecker-glitch
Feb 10, 2026
Merged

Added two explicit types to avoid undesired behaviour of Rascal typechecker#22
mahills merged 1 commit intomainfrom
fix/typechecker-glitch

Conversation

@PaulKlint
Copy link
Member

Two trivial changes (adding an explicit FlowEdge type to both es) to make the Rascal typechecker -- and hopefully us ;-) -- happier:

FlowEdge getBlockEdge(CFGNode n1, CFGNode n2) {
		n1Exit = last(n1.nodes);
		n2Entry = head(n2.nodes);
		edges = { e | FlowEdge e <- g.edges, n1Exit.lab == e.from, n2Entry.lab == e.to };
		if (size(edges) > 1) {
			for (FlowEdge e <- edges)
				println("In <g.item>, found flow edge <e>"); 
			throw "We should not have multiple edges between the same nodes";
		}
		e = getOneFrom(edges);
		return e[from=n1.lab][to=n2.lab];
	}

@mahills
Copy link
Member

mahills commented Feb 10, 2026

I'm fine with that. I'm curious if changing the declaration of edges to set[FlowEdge] edges would have the same impact (there's no need to do it, I'm just legitimately curious).

@mahills mahills merged commit 8031507 into main Feb 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants