summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2026-11-02 18:45:11 +0000
committerMichael Williamson <mike@zwobble.org>2026-11-02 18:45:11 +0000
commit84062cb137c2bc0f18eadcfbcc85a5ca10c81d2b (patch)
tree7dea80a594f4cc7fb2748a33119574e366267200 /src/main/java
parente2ed6fa65aa5ceebc1e822065c9502b3864d118b (diff)
Add note on not needing to explicitly check for non-empty fieldsmain
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/zwobble/hobgoblin/compiler/typechecker/TypeChecker.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/org/zwobble/hobgoblin/compiler/typechecker/TypeChecker.java b/src/main/java/org/zwobble/hobgoblin/compiler/typechecker/TypeChecker.java
index d7fb222..68e078c 100644
--- a/src/main/java/org/zwobble/hobgoblin/compiler/typechecker/TypeChecker.java
+++ b/src/main/java/org/zwobble/hobgoblin/compiler/typechecker/TypeChecker.java
@@ -543,7 +543,10 @@ public class TypeChecker {
);
}
+ // In principle, we should check that fields is non-empty. In practice,
+ // we implicitly check this by requiring a primary key.
var fields = context.fieldsOf(rowType).orElse(List.of());
+
var primaryKeyField = fields.stream()
.filter(field -> field.name().equals(untyped.primaryKey().name()))
.findFirst();