Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
desplesda committed Sep 19, 2023
1 parent 8a15600 commit 2da6fee
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions YarnSpinner.Compiler/TypeCheckerListener.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Uncomment to ensure that all expressions have a known type at compile time
// #define VALIDATE_ALL_EXPRESSIONS
#define DISALLOW_NULL_EQUATION_TERMS

namespace Yarn.Compiler
{
Expand Down Expand Up @@ -152,18 +151,6 @@ private void AddDiagnostic(ParserRuleContext context, string message, Diagnostic

private TypeEqualityConstraint AddEqualityConstraint(IType a, IType b, ParserRuleContext context, FailureMessageProvider failureMessageProvider)
{
#if DISALLOW_NULL_EQUATION_TERMS
if (a == null)
{
throw new ArgumentNullException($"{nameof(a)}");
}

if (b == null)
{
throw new ArgumentNullException($"{nameof(b)}");
}
#endif

TypeEqualityConstraint item = new TypeEqualityConstraint(a ?? Types.Error, b ?? Types.Error);
item.SourceFileName = this.sourceFileName;
item.SourceRange = GetRange(context);
Expand All @@ -176,18 +163,6 @@ private TypeEqualityConstraint AddEqualityConstraint(IType a, IType b, ParserRul

private TypeConvertibleConstraint AddConvertibleConstraint(IType from, IType to, ParserRuleContext context, FailureMessageProvider failureMessageProvider)
{
#if DISALLOW_NULL_EQUATION_TERMS
if (from == null)
{
throw new ArgumentNullException($"{nameof(from)}");
}

if (to == null)
{
throw new ArgumentNullException($"{nameof(to)}");
}
#endif

TypeConvertibleConstraint item = new TypeConvertibleConstraint(from ?? Types.Error, to ?? Types.Error);
item.SourceFileName = this.sourceFileName;
item.SourceRange = GetRange(context);
Expand All @@ -200,12 +175,6 @@ private TypeConvertibleConstraint AddConvertibleConstraint(IType from, IType to,

private void AddHasEnumMemberConstraint(IType type, string memberName, ParserRuleContext context, FailureMessageProvider failureMessageProvider)
{
#if DISALLOW_NULL_EQUATION_TERMS
if (type == null)
{
throw new ArgumentNullException($"{nameof(type)}");
}
#endif
TypeHasMemberConstraint item = new TypeHasMemberConstraint(type, memberName);
item.SourceFileName = this.sourceFileName;
item.SourceRange = GetRange(context);
Expand All @@ -217,13 +186,6 @@ private void AddHasEnumMemberConstraint(IType type, string memberName, ParserRul

private void AddHasNameConstraint(IType type, string name, ParserRuleContext context, FailureMessageProvider failureMessageProvider)
{
#if DISALLOW_NULL_EQUATION_TERMS
if (type == null)
{
throw new ArgumentNullException($"{nameof(type)}");
}
#endif

TypeHasNameConstraint item = new TypeHasNameConstraint(type, name);
item.SourceFileName = this.sourceFileName;
item.SourceRange = GetRange(context);
Expand Down

0 comments on commit 2da6fee

Please sign in to comment.