parent
4fb2053f34
commit
1d865afe7f
|
|
@ -42,8 +42,10 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
{
|
||||
if (_modelStatementFound && _endInheritsLocation.HasValue)
|
||||
{
|
||||
Context.OnError(_endInheritsLocation.Value,
|
||||
Resources.FormatMvcRazorCodeParser_CannotHaveModelAndInheritsKeyword(ModelKeyword));
|
||||
Context.OnError(
|
||||
_endInheritsLocation.Value,
|
||||
Resources.FormatMvcRazorCodeParser_CannotHaveModelAndInheritsKeyword(ModelKeyword),
|
||||
SyntaxConstants.CSharp.InheritsKeyword.Length);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -60,9 +62,10 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
|
||||
if (_modelStatementFound)
|
||||
{
|
||||
Context.OnError(startModelLocation,
|
||||
Resources.FormatMvcRazorCodeParser_OnlyOneModelStatementIsAllowed(ModelKeyword),
|
||||
ModelKeyword.Length);
|
||||
Context.OnError(
|
||||
startModelLocation,
|
||||
Resources.FormatMvcRazorCodeParser_OnlyOneModelStatementIsAllowed(ModelKeyword),
|
||||
ModelKeyword.Length);
|
||||
}
|
||||
|
||||
_modelStatementFound = true;
|
||||
|
|
|
|||
|
|
@ -68,10 +68,13 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
_modelExpressionTypeName,
|
||||
StringComparison.Ordinal))
|
||||
{
|
||||
errorSink.OnError(SourceLocation.Undefined, Resources.FormatMvcRazorParser_InvalidPropertyType(
|
||||
descriptor.TypeName,
|
||||
attributeDescriptor.Name,
|
||||
_modelExpressionTypeName));
|
||||
errorSink.OnError(
|
||||
SourceLocation.Undefined,
|
||||
Resources.FormatMvcRazorParser_InvalidPropertyType(
|
||||
descriptor.TypeName,
|
||||
attributeDescriptor.Name,
|
||||
_modelExpressionTypeName),
|
||||
length: 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
|||
GetOptions(fileProvider));
|
||||
var errors = new[]
|
||||
{
|
||||
new RazorError("message-1", new SourceLocation(1, 2, 17)),
|
||||
new RazorError("message-1", new SourceLocation(1, 2, 17), length: 1),
|
||||
new RazorError("message-2", new SourceLocation(viewPath, 1, 4, 6), 7),
|
||||
new RazorError { Message = "message-3" },
|
||||
new RazorError("message-4", new SourceLocation(viewImportsPath, 1, 3, 8), 4),
|
||||
|
|
|
|||
Loading…
Reference in New Issue