Skip to content

Commit

Permalink
changed system.type to type
Browse files Browse the repository at this point in the history
  • Loading branch information
Jet8100 committed Apr 15, 2024
1 parent d7fd4a0 commit 1891119
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 17 deletions.
16 changes: 15 additions & 1 deletion SocietalConstructionTool/Compiler/SctType.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
using System.CommandLine.IO;

using Microsoft.CodeAnalysis.CSharp.Syntax;

namespace Sct.Compiler
{
public class SctType(Type targetType)
{
public Type TargetType { get; } = targetType;

private static readonly Dictionary<Type, string> Types = new()
{
{ typeof(int), "int" },
{ typeof(double), "float" },
{ typeof(void) , "void" },
};

public string TargetType { get; } = Types[targetType];

private void Type(Type targetType) => throw new NotImplementedException();
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Line 7, Column 4: Cannot assign System.Double to System.Int32
Line 8, Column 4: Cannot assign System.Void to System.Int32
Line 7, Column 4: Cannot assign float to int
Line 8, Column 4: Cannot assign void to int
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Line 10, Column 11: Cannot convert System.Double to System.Int32
Line 11, Column 11: Cannot convert System.Double to System.Int32
Line 10, Column 11: Cannot convert float to int
Line 11, Column 11: Cannot convert float to int
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Line 2, Column 4: Cannot assign System.Double to System.Int32
Line 3, Column 4: Cannot assign System.Double to System.Int32
Line 2, Column 4: Cannot assign float to int
Line 3, Column 4: Cannot assign float to int
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Line 6, Column 4: Cannot convert System.Double to System.Int32 in call expression.
Line 7, Column 4: Cannot convert System.Double to System.Int32 in call expression.
Line 6, Column 4: Cannot convert float to int in call expression.
Line 7, Column 4: Cannot convert float to int in call expression.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Line 5, Column 15: Cannot convert System.Double to System.Int32 in predicate.
Line 7, Column 15: Cannot convert System.Double to System.Int32 in predicate.
Line 5, Column 15: Cannot convert float to int in predicate.
Line 7, Column 15: Cannot convert float to int in predicate.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Line 4, Column 8: Cannot typecast from System.Int32 to System.Void.
Line 4, Column 4: Cannot assign System.Void to System.Double
Line 4, Column 8: Cannot typecast from int to void.
Line 4, Column 4: Cannot assign void to float
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Line 2, Column 3: Variable cannot be of type: System.Void
Line 2, Column 3: Cannot assign System.Int32 to System.Void
Line 2, Column 3: Variable cannot be of type: void
Line 2, Column 3: Cannot assign int to void
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Line 4, Column 4: Cannot convert System.Int32 to System.Void in call expression.
Line 4, Column 4: Cannot convert int to void in call expression.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Line 2, Column 4: Cannot convert the returned type to the function's expected return type, expected expression of type System.Void, got System.Int32.
Line 2, Column 4: Cannot convert the returned type to the function's expected return type, expected expression of type void, got int.

0 comments on commit 1891119

Please sign in to comment.