-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Resolver] Wrote reproducing test for #192
- Loading branch information
Alexander Bothe
committed
Aug 13, 2015
1 parent
caf9e14
commit 8d2450b
Showing
3 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
using D_Parser.Dom; | ||
using D_Parser.Dom.Expressions; | ||
using D_Parser.Dom.Statements; | ||
using D_Parser.Misc; | ||
using D_Parser.Parser; | ||
using D_Parser.Resolver; | ||
using D_Parser.Resolver.ASTScanner; | ||
using D_Parser.Resolver.ExpressionSemantics; | ||
using D_Parser.Resolver.Templates; | ||
using D_Parser.Resolver.TypeResolution; | ||
using NUnit.Framework; | ||
using System.IO; | ||
using D_Parser.Completion; | ||
|
||
namespace Tests | ||
{ | ||
public partial class ResolutionTests | ||
{ | ||
#region Template Parameter-related | ||
[Test] | ||
/// <summary> | ||
/// https://github.com/aBothe/D_Parser/issues/192 | ||
/// </summary> | ||
public void TemplateValueParameterDefaultSelfRefSO(){ | ||
var code = @"module A; | ||
struct Template( void var = Template ) {} | ||
"; | ||
AbstractType t; | ||
IExpression x; | ||
DModule A; | ||
var ctxt = CreateDefCtxt("A", out A, code); | ||
|
||
x = (N<DClassLike>(A, "Template").TemplateParameters[0] as TemplateValueParameter).DefaultExpression; | ||
|
||
t = ExpressionTypeEvaluation.EvaluateType(x, ctxt); | ||
|
||
Assert.That(t, Is.TypeOf(typeof(StructType))); | ||
} | ||
#endregion | ||
|
||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters