Virginia’s law states: "Delegates and alternates shall be bound to vote on the first ballot at the national convention for the candidate receiving the most votes in the primary unless that candidate releases those delegates and alternates from such vote."
Currently, that is Trump. However, the federal law that supersedes it “guarantees delegates to the Republican Party's and Democratic Party's national conventions the right to vote their conscience, free from government compulsion.” That federal law is the First Amendment of the Constitution.