From 189e5a95569eb3d8ad9a602a77a4b1dae0645a4d Mon Sep 17 00:00:00 2001 From: Neta London Date: Wed, 3 Jan 2024 13:06:48 +0200 Subject: [PATCH] Raise error when having multiple internal pins with the same name --- simulator/src/chip/builder.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/simulator/src/chip/builder.ts b/simulator/src/chip/builder.ts index 8c14e4b5b..e93afefb9 100644 --- a/simulator/src/chip/builder.ts +++ b/simulator/src/chip/builder.ts @@ -157,6 +157,12 @@ export async function build( firstUse: rhs.span, }); } else { + if (pinData.isDefined) { + return Err({ + message: `Internal pin ${rhs.pin} already defined`, + span: rhs.span, + }); + } pinData.isDefined = true; } }