30 references to TryGetSpeculativeSemanticModel
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (30)
Semantics\PrimaryConstructorTests.cs (15)
2069
Assert.False(model.
TryGetSpeculativeSemanticModel
(otherBasePosition, speculativePrimaryInitializer, out _));
2071
Assert.True(model.
TryGetSpeculativeSemanticModel
(baseWithargs.SpanStart, speculativePrimaryInitializer, out speculativeModel));
2076
Assert.True(model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer, out speculativeModel));
2087
Assert.Throws<ArgumentNullException>(() => model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (PrimaryConstructorBaseTypeSyntax)null, out _));
2088
Assert.Throws<ArgumentException>(() => model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, baseWithargs, out _));
2133
Assert.False(model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer, out _));
2221
Assert.False(model.
TryGetSpeculativeSemanticModel
(otherBasePosition, speculativePrimaryInitializer, out _));
2223
Assert.False(model.
TryGetSpeculativeSemanticModel
(baseWithargs.SpanStart, speculativePrimaryInitializer, out _));
2224
Assert.False(model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer, out _));
2226
Assert.Throws<ArgumentNullException>(() => model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (PrimaryConstructorBaseTypeSyntax)null, out _));
2227
Assert.Throws<ArgumentException>(() => model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, baseWithargs, out _));
2272
Assert.False(model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer, out _));
2373
Assert.False(model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBase, out _));
2379
Assert.False(model.
TryGetSpeculativeSemanticModel
(baseWithoutargs.ArgumentList.OpenParenToken.SpanStart, speculativeBase, out _));
2384
Assert.False(model.
TryGetSpeculativeSemanticModel
(baseWithoutParens.SpanStart + 2, speculativeBase, out _));
Semantics\RecordStructTests.cs (3)
10781
Assert.False(model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBase, out _));
10787
Assert.False(model.
TryGetSpeculativeSemanticModel
(baseWithoutargs.ArgumentList.OpenParenToken.SpanStart, speculativeBase, out _));
10792
Assert.False(model.
TryGetSpeculativeSemanticModel
(baseWithoutParens.SpanStart + 2, speculativeBase, out _));
Semantics\RecordTests.cs (12)
22300
Assert.False(model.
TryGetSpeculativeSemanticModel
(otherBasePosition, speculativePrimaryInitializer, out _));
22302
Assert.True(model.
TryGetSpeculativeSemanticModel
(baseWithargs.SpanStart, speculativePrimaryInitializer, out speculativeModel!));
22307
Assert.True(model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer, out speculativeModel!));
22318
Assert.Throws<ArgumentNullException>(() => model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (PrimaryConstructorBaseTypeSyntax)null!, out _));
22319
Assert.Throws<ArgumentException>(() => model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, baseWithargs, out _));
22364
Assert.False(model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer, out _));
22452
Assert.False(model.
TryGetSpeculativeSemanticModel
(otherBasePosition, speculativePrimaryInitializer, out _));
22454
Assert.False(model.
TryGetSpeculativeSemanticModel
(baseWithargs.SpanStart, speculativePrimaryInitializer, out _));
22455
Assert.False(model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer, out _));
22457
Assert.Throws<ArgumentNullException>(() => model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (PrimaryConstructorBaseTypeSyntax)null!, out _));
22458
Assert.Throws<ArgumentException>(() => model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, baseWithargs, out _));
22503
Assert.False(model.
TryGetSpeculativeSemanticModel
(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer, out _));