Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

[VS2015] ccrewrite fails with CC1004: Malformed contract. Found Requires after assignment in method  #221

Description

@DzonnyDZ

Note: This situation is different from #133.
I tried the fixed ccrewrite mentioned in #133
, but it didn't help me. I'm still getting the error on code like this.

public void MoveFilesToAccessibleStorage(string ugcTempFolderLocal, string ugcTempFolderRemote, string appDrive)
        {
            Contract.Requires<ArgumentNullException>(ugcTempFolderLocal != null, "ugcTempFolder");
            Contract.Requires<ArgumentException>(ugcTempFolderLocal != string.Empty);
            Contract.Requires<ArgumentException>(!ugcTempFolderLocal.Contains(IO.Path.GetInvalidPathChars()));
            Contract.Requires<ArgumentException>(!ugcTempFolderLocal.Contains(":"));
            Contract.Requires<ArgumentException>(!ugcTempFolderLocal.EndsWith("\\") && !ugcTempFolderLocal.EndsWith("/"), "Do not provide trailing slashes for folder names");
            Contract.Requires<ArgumentException>(!ugcTempFolderLocal.StartsWith("\\", "/") || ugcTempFolderLocal.StartsWith("\\\\", "//", "\\/", "/\\"));
            Contract.Requires<ArgumentNullException>(appDrive != null, "appDrive");
            FileSystemHelper.ContractRequireRelativeFolderName(ugcTempFolderRemote);
            Contract.Requires<ArgumentException>(appDrive.Like("[A-Za-z]:\\"));
        }

on the line

Contract.Requires<ArgumentException>(!ugcTempFolderLocal.StartsWith("\\", "/") || ugcTempFolderLocal.StartsWith("\\\\", "//", "\\/", "/\\"));

20>C:\Pangea\common\RFERL.IBll\Backend\IAudioOperations.cs(116,13): error CC1004: Malformed contract. Found Requires after assignment in method 'RFERL.Bll.Backend.IAudioOperationsContract.MoveFilesToAccessibleStorage(System.String,System.String,System.String)'.

I'm creating this issue to be able to trace it separately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions