From 26eff47057388802ac5718b55a45ec6cb1eaa858 Mon Sep 17 00:00:00 2001 From: nitrix Date: Thu, 23 Mar 2023 13:09:52 +0100 Subject: [PATCH] Fix typos. --- src/main/java/de/hsrm/compiler/Klang/types/BooleanType.java | 2 +- src/main/java/de/hsrm/compiler/Klang/types/FloatType.java | 2 +- src/main/java/de/hsrm/compiler/Klang/types/IntegerType.java | 2 +- src/main/java/de/hsrm/compiler/Klang/types/NullType.java | 2 +- src/test/java/ConstructorCallTest.java | 4 ++-- src/test/java/FunctionCallTest.java | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/de/hsrm/compiler/Klang/types/BooleanType.java b/src/main/java/de/hsrm/compiler/Klang/types/BooleanType.java index 8e3f27a..0964131 100644 --- a/src/main/java/de/hsrm/compiler/Klang/types/BooleanType.java +++ b/src/main/java/de/hsrm/compiler/Klang/types/BooleanType.java @@ -32,7 +32,7 @@ public class BooleanType extends PrimitiveType { } // Every remaining type will throw a RuntimeException - throw new RuntimeException("Type missmatch: cannot combine " + this.getName() + " and " + that.getName()); + throw new RuntimeException("Type mismatch: cannot combine " + this.getName() + " and " + that.getName()); } @Override diff --git a/src/main/java/de/hsrm/compiler/Klang/types/FloatType.java b/src/main/java/de/hsrm/compiler/Klang/types/FloatType.java index cb383d5..74b68a8 100644 --- a/src/main/java/de/hsrm/compiler/Klang/types/FloatType.java +++ b/src/main/java/de/hsrm/compiler/Klang/types/FloatType.java @@ -36,7 +36,7 @@ public class FloatType extends NumericType { } // Every remaining type will throw a RuntimeException - throw new RuntimeException("Type missmatch: cannot combine " + this.getName() + " and " + that.getName()); + throw new RuntimeException("Type mismatch: cannot combine " + this.getName() + " and " + that.getName()); } @Override diff --git a/src/main/java/de/hsrm/compiler/Klang/types/IntegerType.java b/src/main/java/de/hsrm/compiler/Klang/types/IntegerType.java index 7eccf14..f413d5b 100644 --- a/src/main/java/de/hsrm/compiler/Klang/types/IntegerType.java +++ b/src/main/java/de/hsrm/compiler/Klang/types/IntegerType.java @@ -36,7 +36,7 @@ public class IntegerType extends NumericType { } // Every remaining type will throw a RuntimeException - throw new RuntimeException("Type missmatch: cannot combine " + this.getName() + " and " + that.getName()); + throw new RuntimeException("Type mismatch: cannot combine " + this.getName() + " and " + that.getName()); } @Override diff --git a/src/main/java/de/hsrm/compiler/Klang/types/NullType.java b/src/main/java/de/hsrm/compiler/Klang/types/NullType.java index 0e2cf62..dbb0505 100644 --- a/src/main/java/de/hsrm/compiler/Klang/types/NullType.java +++ b/src/main/java/de/hsrm/compiler/Klang/types/NullType.java @@ -23,7 +23,7 @@ public class NullType extends Type { public Type combine(Type that) { // You can not combine null with a primitive type if (that.isPrimitiveType()) { - throw new RuntimeException("Type missmatch: cannot combine " + this.getName() + " and " + that.getName()); + throw new RuntimeException("Type mismatch: cannot combine " + this.getName() + " and " + that.getName()); } // Everything else combines with null to the type it was before diff --git a/src/test/java/ConstructorCallTest.java b/src/test/java/ConstructorCallTest.java index 9d21d29..343bfa0 100644 --- a/src/test/java/ConstructorCallTest.java +++ b/src/test/java/ConstructorCallTest.java @@ -21,7 +21,7 @@ public class ConstructorCallTest { } @Test - void numConstructorParameterMissmatch() { + void numConstructorParametermismatch() { ParseTree tree = Helper.prepareParser("struct bar { a: int; } function foo(): bar { return create bar(1, false); } foo();"); var funcs = Helper.getFuncs(tree); var structs = Helper.getStructs(tree); @@ -41,6 +41,6 @@ public class ConstructorCallTest { ContextAnalysis ctxAnal = new ContextAnalysis(funcs, structs, enums); Exception e = assertThrows(RuntimeException.class, () -> ctxAnal.visit(tree)); - assertEquals("Error in line 1:63 argument 0 Type missmatch: cannot combine bool and int", e.getMessage()); + assertEquals("Error in line 1:63 argument 0 Type mismatch: cannot combine bool and int", e.getMessage()); } } \ No newline at end of file diff --git a/src/test/java/FunctionCallTest.java b/src/test/java/FunctionCallTest.java index ce3876f..0a1dea8 100644 --- a/src/test/java/FunctionCallTest.java +++ b/src/test/java/FunctionCallTest.java @@ -33,7 +33,7 @@ public class FunctionCallTest { } @Test - void parameterTypeMissmatch() { + void parameterTypeMismatch() { ParseTree tree = Helper.prepareParser("function foo(x: int): int { return x; } foo(false);"); var funcs = Helper.getFuncs(tree); var structs = Helper.getStructs(tree);